Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autosave Causes Cursor to Jump #13

Open
ydax opened this issue Aug 30, 2022 · 1 comment
Open

Autosave Causes Cursor to Jump #13

ydax opened this issue Aug 30, 2022 · 1 comment

Comments

@ydax
Copy link

ydax commented Aug 30, 2022

Hey Luke
I'm not sure whether this is an "issue" or not with this library, but this was the best place I could find to bring this up.
We're using this library as a compliment to the TinyMCE WYSIWYG editor and I'm finding a problem. It's that, on autosave, the cursor jumps to the beginning of the editor. So, you can imagine that it's really frustrating for our users who are typing, then get an autosave, then have their cursor jump to the beginning of what they were writing.
Have you experienced this kind of behavior when using the library? Do you reckon this is an issue that could be improved in the library--maybe as a feature / prop--or something that should be handled in our App instead? I can't really think of a way where we would keep the cursor position in state or anything like that in our App.
Basically, the autosave causes the React component to re-render I reckon, which then causes the cursor to jump back to the default position.
Kind regards,
Davis

@lukesmurray
Copy link
Owner

Just saw this. The issue is most likely due to the editor re-rendering and losing selection. If you can track down what is causing the re-render then I can help.

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

No branches or pull requests

2 participants