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

Cursor moves to beginning of document after typing #137

Open
lightninglu10 opened this issue Feb 13, 2018 · 4 comments
Open

Cursor moves to beginning of document after typing #137

lightninglu10 opened this issue Feb 13, 2018 · 4 comments

Comments

@lightninglu10
Copy link

Super weird behavior, after i load some code into the editor, and then type something, the cursor goes back to the first line in the editor:

screen shot 2018-02-12 at 5 47 42 pm

screen shot 2018-02-12 at 5 47 46 pm

@Younguser
Copy link

I've saw the same problem. Do you solve it?

@mjbradford89
Copy link

having the same problem. version 5.37.0

@lightninglu10
Copy link
Author

This library doesn't seem to be maintained anymore, so I used https://github.com/scniro/react-codemirror2 instead.

@fahad39
Copy link

fahad39 commented Jan 16, 2023

Instead of updating content in onChange props try using onblur
<JoditEditor
ref={editor}
value={content}
config={config}
tabIndex={1} // tabIndex of textarea
onBlur={newContent => setContent(newContent)} // preferred to use only this option to update the content for performance reasons
onChange={newContent => {}}
/>

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

4 participants