react-native-rich-editor icon indicating copy to clipboard operation
react-native-rich-editor copied to clipboard

Scroll into view

Open cristianoccazinsp opened this issue 3 years ago • 2 comments

When focusing the editor, if there's scrolling and the selection is below the scroll position (e.g., end), the current implementation will not adjust the scroll position to the caret position.

With this PR, I'm adding some code that will also scroll to the caret position using a hacky work-around found on stack overflow (https://stackoverflow.com/questions/47361276/javascript-scroll-to-cursor-post-a-paste-in-contenteditable-div).

Further, I'm also exposing the scrollSelectionIntoView method.

Lastly, I've also added missing calls to saveSelection so cursor state is always up to date.

@stulip please review and let me know your thoughts.

cristianoccazinsp avatar Apr 28 '22 20:04 cristianoccazinsp

@cristianocca I was just looking for this functionality. I've got my own fork in my project now with a few small things. I'm going to try merging this into mine and seeing how it works 👍

jakehasler avatar Apr 28 '22 21:04 jakehasler

Thank you, I need some examples to verify this problem

stulip avatar Apr 03 '23 09:04 stulip