Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

States are out of sync on android when auto-correction is enabled #2676

Open
PedroRestrepo opened this issue Oct 23, 2020 · 5 comments
Open

Comments

@PedroRestrepo
Copy link

PedroRestrepo commented Oct 23, 2020

Do you want to request a feature or report a bug?

Report a bug

What is the current behavior?

on Android devices with auto-correction enabled on the keyboard, the editor state is not updating until the word is autocorrected (until a while space or special character is typed). This causes issues with inline styles as they cannot be applied correctly.

draftjs-bug

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started: https://jsfiddle.net/gmertk/e61z7nfa/.

https://angry-archimedes-e81339.netlify.app/
https://jsfiddle.net/z83ehc1x/

What is the expected behavior?

That the editor state is updated as the user is typing (even before the auto-correction changes the spelling of the word)

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?

"dependencies": { "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "draft-js": "^0.11.7", "es6-shim": "^0.35.6", "react": "^17.0.1", "react-dom": "^17.0.1", "react-scripts": "4.0.0", "web-vitals": "^0.2.4" }

Might be related to #2171, #2176

@appaquet
Copy link

@PedroRestrepo I see you are using React 17. I had similar out-of-sync / jumping cursors issues on iOS using React 17 and reverting to React 16 fixed it. My hunch is that it may be related to the events handling changes in React 17.

@PedroRestrepo
Copy link
Author

@appaquet Thanks for the suggestion! just tried with React 16 and still seeing the same issue unfortunately

@splintor
Copy link

I seem to have the same problem. 😞
Any workaround?

@splintor
Copy link

(Might be related to #1895)

@markcorrea
Copy link

I'm also having this issue on Android. Has anyone already figured out a workaround for this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants