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

Fix cursor reset after innerRef initialized #317

Closed
wants to merge 1 commit into from

Conversation

ekzyis
Copy link
Member

@ekzyis ekzyis commented Jun 13, 2023

The error was caused because innerRef.current is not initialized on first render. On second render (after the user typed something), it is and thus useEffect runs with the default values (start: 0, end: 0); resetting the cursor.

So I fixed it by removing the dependency on innerRef.current.

Closes #316

@ekzyis ekzyis added the bug label Jun 13, 2023
components/form.js Outdated Show resolved Hide resolved
@huumn huumn closed this Jun 13, 2023
@ekzyis ekzyis deleted the 316-edit-mode-broken branch June 13, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cursor jumps to start on first keypress after entering edit mode
2 participants