-
Notifications
You must be signed in to change notification settings - Fork 251
fix(chrome-ext): Applying suggestions breaks cursor/keyboard in Draft.js and Slate editors #2495
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
base: master
Are you sure you want to change the base?
Conversation
|
This looks great! I'm tempted to just hit merge now. Before I can do that, I would like to know: Did you end up having a go at writing an integration test to make sure it now works as expected on Draft.js? If not, that's totally fine, but I would like to know if you encountered any snags. I'm curious if this PR has the potential to address #2470. |
Was planning to add integration tests. Checked the existing ones and some use local mocks, others use live sites (Slate, Lexical). Was initially hesitant about depending on an external live page, but setting up a local Draft.js mock with React felt overly complex. Since you mentioned test, i reconsidered it and going with https://draftjs.org/ seems simpler and consistent with the other editor tests. Tested manually as of now and it works fine. Will push the tests shortly. Let me know if you have any suggestions. For #2470 - symptoms look identical. I'll check what editor Discord uses and if it's not already fixed by this PR, I'll include the fix here. |
Issues
Fixes #2494
Fixes #2470
Description
Applying suggestions in Draft.js (X/Twitter) and Slate (Discord) editors broke keyboard input.
Fix: Use surgical text replacement with
execCommandthat editors can observe and sync their internal state.How Has This Been Tested?
Checklist