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

fix macos accent menu when using arrow keys #5046

Merged

Conversation

BitPhinix
Copy link
Contributor

Description
Fixes inserting accented characters using the macOS accent menu when using arrow keys

Issue
Fixes: #5038

Example

Before:
before

After:
after

Context

Screenshot 2022-07-11 at 14 05 09

When holding down 'a' to type a with an accent the first 'ArrowLeft' key down is triggered with isComposing=false and before any event indicating that it is composing. Immediately afterward the 'normal' composition start/update events are fired and all following events have isComposing properly set, and because the composition start is fired before the selection change selecting the character / after the beforeinput we keep the selection obtained by manually handling the arrow keys which doesn't match the dom state and insert there because chrome doesn't fire the insertFromComposition.

Checks

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn fix.)
  • The relevant examples still work. (Run examples with yarn start.)
  • You've added a changeset if changing functionality. (Add one with yarn changeset add.)

@changeset-bot
Copy link

changeset-bot bot commented Jul 11, 2022

🦋 Changeset detected

Latest commit: 8164385

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
slate-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dylans dylans merged commit f96b659 into ianstormtaylor:main Jul 15, 2022
This was referenced Jul 15, 2022
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.

[IME] Chrome/macOS: entering accented letters from the Accent Menu using arrow keys inserts double character
2 participants