-
-
Notifications
You must be signed in to change notification settings - Fork 140
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 the beginning of the line while typing quickly if the CodeMirror is controlled and the render of the component containing CodeMirror takes too long #694
Comments
Yeah. This is pretty bad. I now have to type code character by character otherwise the cursor jumps to the beginning and messes everything up. |
This helped me but not sure if it will help you. So I was looking at this issue and I modified the code here to also call the user provided |
cephalization
added a commit
to Arize-ai/phoenix
that referenced
this issue
Jan 31, 2025
…o uncontrolled components Workaround for uiwjs/react-codemirror#694
cephalization
added a commit
to Arize-ai/phoenix
that referenced
this issue
Feb 3, 2025
* refactor(prompts): Normalize playground instance messages * Update use-zustand package to improve performance * Convert TemplateEditor, VariableEditor, and PlaygroundTool (editor) to uncontrolled components Workaround for uiwjs/react-codemirror#694 * Clean up variable names and semantics * Mark instance as dirty when updating message
mikeldking
pushed a commit
to Arize-ai/phoenix
that referenced
this issue
Feb 6, 2025
* refactor(prompts): Normalize playground instance messages * Update use-zustand package to improve performance * Convert TemplateEditor, VariableEditor, and PlaygroundTool (editor) to uncontrolled components Workaround for uiwjs/react-codemirror#694 * Clean up variable names and semantics * Mark instance as dirty when updating message
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! I believe I'm running into a bug. My symptoms are similar to the old #199, but I'm using the latest version (
4.23.6
) and also the workaround from #199 (comment) does not work for me.So, I'm typing into my controlled
<CodeMirror>
and, every few keystrokes, the cursor jumps to the beginning of the text box. I believe triggering the issue is dependent on<CodeMirror>
being used in a "heavy" component: if the parent of<CodeMirror>
(which supplies thevalue
) is simple, then I don't get the cursor jump. If the parent component has a bunch of other sub-components (and so the render takes longer), then I do get the bug -- so I suspect the issue is some sort of race condition whereby an update ofvalue
arrives "too late", after more key presses.My
CodeMirror
invocation looks like this:If I remove
<MyOtherHeavyComponent/>
, then it all works fine. Also, if I type slowly, it again works fine.The text was updated successfully, but these errors were encountered: