We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfRichTextEditor not scrolling to cursor position

When I set the CursorPosition property it is natural to expect that the text editor will scroll to that position so that the line is visible. But this does not happen.


After setting the cursor, the user has to manually scroll to that position in order to make it visible.


Have multiple lines in the text editor so that you have a vertical scroll bar in order to test this.


Currently there are only methods as MoveCursorToTop and MoveCursorToEnd. These functions will scroll the view. But there is no way to scroll the view to specific cursor position automatically or programatically.


This is really important for smooth experience.


EDIT: Also it appears to me that the the view doesn't scroll to cursor especially when the soft-keyboard is open.


Regards,

Gautam Jain



7 Replies

MP Mohana Priya Raja Syncfusion Team April 21, 2023 04:58 PM UTC

Based on your last update, we suspect that you would like to scroll the view based on the cursor position. For example, if you want to move the cursor at 100 positions then the view also scrolled.

If our understanding is different from your requirement, could you please explain elaborately about your requirement? It will be useful for us to investigate further on this and assist you with a better solution at the earliest.



GJ Gautam Jain April 22, 2023 05:03 AM UTC

That's right. Your understanding is correct.

Currently the view doesn't scroll when I set the cursor position. Please check this both when soft-keyboard is hidden state and also visible state.

Either setting cursor position should automatically scroll. Or separate method can be provided to scroll the view to specific cursor position. 


richTextEditor.HtmlText = html;

rictTextEditor.CursorPosition = 400;


The above code doesn't scroll. If scrolls sometimes if I set the cursor position using a timer.. like after 200ms.


But when the soft-keyboard, the scrolling doesn't happen even if I use the timer.



HD Hemalatha Duraisamy Syncfusion Team April 24, 2023 04:51 PM UTC

Currently, we are validating your requirement and we will update the further details on 26th April 2023.



HD Hemalatha Duraisamy Syncfusion Team April 26, 2023 05:40 PM UTC

We have confirmed that the issue with "The RichTextEditor does not scroll based on the corresponding courser position in android and UWP Platform ". is a defect and have logged a defect report for this issue. The fix for the issue will be include in our upcoming weekly NuGet published under nuget.org and it is expected to be available on 10th May 2023.

Feedback Link: https://www.syncfusion.com/feedback/43198/the-richtexteditor-does-not-scroll-based-on-the-corresponding-courser-position


Note: Set the CursorPosition based on the character count will not working in the Xamarin RichTextEditor iOS due to the control focus limitation. Please find the more detail in the below UG link.

https://help.syncfusion.com/xamarin/rich-text-editor/overview#ios

Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”



HD Hemalatha Duraisamy Syncfusion Team May 10, 2023 04:58 PM UTC

We have included the fix for the reported issue “The RichTextEditor does not scroll based on the corresponding courser position in android and UWP Platform” in our weekly NuGet release v21.2.4 Please find the download link from below, 


https://www.nuget.org/packages/Syncfusion.Xamarin.SfRichTextEditor/21.2.4



GJ Gautam Jain May 12, 2023 03:49 AM UTC


Thanks a lot Hemalatha for the fix. 


I will use it in our next update.


Regards,

Gautam Jain



SS Swetha Srikumar Syncfusion Team May 12, 2023 04:47 AM UTC

Most welcome.

Please check and get back to us.



Loader.
Live Chat Icon For mobile
Up arrow icon