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

A-11847: Fix long pressed accents on Chrome+MacOS #8

Draft
wants to merge 2 commits into
base: 0-47-merged-backports
Choose a base branch
from

Conversation

mbillard
Copy link

No description provided.

mbillard and others added 2 commits May 12, 2021 16:28
Fix copied from ianstormtaylor#3113

On macOS, long press triggers an IME to insert an accent. Browsers that implements beforeinput event uses the insertReplacementText and a proper range. Chrome is instead selecting the character to replace, right when the input is triggered.

If we detect macOS && Chrome, the we proceed to check if the DOM selection has been updated before the input event and a detection of a selection change. The check is very naive but enough for this particular case. This can't happen when previous editor selection was expanded I guess.

I had to expose through a query the composition state of the before plugin, this is used to discard completely this fix in case of a user using another IME.

Co-Authored-By: Matthew Saunders <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant