react-native-rich-editor
react-native-rich-editor copied to clipboard
Scroll into view
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.
@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 👍
Thank you, I need some examples to verify this problem