Skip to content

Conversation

@cristianoccazinsp
Copy link

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.

@jakehasler
Copy link
Contributor

@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 👍

@stulip
Copy link
Member

stulip commented Apr 3, 2023

Thank you, I need some examples to verify this problem

@stulip
Copy link
Member

stulip commented Jul 22, 2025

This branch has conflicts that must be resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants