You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to update my app to React 18 but I'm seeing some unexpected behavior with the cursor jumping while typing, as well as indentation not working the same as before. Please see the below codesandbox for a demonstration:
In the editor using React 18, if I try to start typing a JSON object with {, it jumps my cursor to after the closing curly brace that it added for me, instead of in between them as before. Next, if I move my cursor between the curly braces and press enter, it does add the newline but moves my cursor to the very start, before the opening curly brace. If I then move my cursor into the object and type " to start typing an object property, it moves my cursor back once again. There seem to be issues with the cursor when the editor tries to reformat things automatically, such as adding closing braces/quotes or adding extra newlines when pressing enter inside an object.
The codesandbox also includes the same code editor component rendered with ReactDOM.render instead, which reverts back to React 17, and it has no such issues.
Any help or insight with this would be appreciated, thanks!
The text was updated successfully, but these errors were encountered:
Hello,
I'm trying to update my app to React 18 but I'm seeing some unexpected behavior with the cursor jumping while typing, as well as indentation not working the same as before. Please see the below codesandbox for a demonstration:
https://codesandbox.io/p/sandbox/react-codemirror2-9smx2h?file=%2Fsrc%2FApp.js
In the editor using React 18, if I try to start typing a JSON object with
{
, it jumps my cursor to after the closing curly brace that it added for me, instead of in between them as before. Next, if I move my cursor between the curly braces and press enter, it does add the newline but moves my cursor to the very start, before the opening curly brace. If I then move my cursor into the object and type"
to start typing an object property, it moves my cursor back once again. There seem to be issues with the cursor when the editor tries to reformat things automatically, such as adding closing braces/quotes or adding extra newlines when pressing enter inside an object.The codesandbox also includes the same code editor component rendered with
ReactDOM.render
instead, which reverts back to React 17, and it has no such issues.Any help or insight with this would be appreciated, thanks!
The text was updated successfully, but these errors were encountered: