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

Content model: fix keyboard delete issue on Android #2402

Merged

Conversation

Rain-Zheng
Copy link
Contributor

Some Android IMEs (such as Gboard and Samsung keyboard) don't support KeyboardEvent well. The key property of keyboard events will always be Unidentified when using these IMEs. To workaround this issue, we need to handle InputEvent instead.

The PR changes the DOM event handling logic in EditPlugin:

  1. When receiving Unidentified keyboard event on Android, check the next beforeinput event.
  2. Create a keyboard event with correct key according to the type of input event: deleteContentBackward corresponds to Backspace key, and deleteContentForward corresponds to Delete key.
  3. Use the created keyboard event to trigger keyboardDelete.

@Rain-Zheng Rain-Zheng changed the title Content model: fix keyboard delete issue on Android #2318 Content model: fix keyboard delete issue on Android Feb 7, 2024
@JiuqingSong JiuqingSong merged commit f74b890 into microsoft:master Feb 8, 2024
4 checks passed
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.

2 participants