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

Read-only entity element can't be deleted by pressing backspace key when using Android IME #2318

Closed
Rain-Zheng opened this issue Jan 9, 2024 · 3 comments

Comments

@Rain-Zheng
Copy link
Contributor

Describe the bug
When using Android soft keyboard (Gboard), the read-only entity element can't be deleted by pressing backspace. Similar to some previous issues, the root cause is some Android IMEs don't support KeyboardEvent.key and this value will always be 229(Unidentified). To workaround the compatibility issue, we should use InputEvent instead.

We may need to handle InputEvent in at least 2 plugins:

  • EditPlugin, it should dispatch the input event to entityFeatures. And the related features including RemoveEntityBetweenDelimitersFeature, DeleteBeforeEntityFeature, BackspaceAfterEntityFeature should also support input event.
  • ContentModelEditPlugin and its related logic like keyboardDelete should support input event.

To Reproduce
Steps to reproduce the behavior:

  1. Insert a read-only entity into the demo editor
  2. Try to delete it using Android IME

Screenshots

Screen_Recording_20240109_184256_Chrome.mp4

Device Information

  • OS: Android
  • Browser Chrome
  • Version 119

Additional context
Similar issues:
#513
#2061

@Rain-Zheng
Copy link
Contributor Author

@JiuqingSong could you take a look at this issue?

@JiuqingSong
Copy link
Collaborator

Thanks for reporting. Would you like to contribute a fix?

Thanks.

@Rain-Zheng
Copy link
Contributor Author

@JiuqingSong I created a PR: #2402, could you take a look when you have time? Thanks.

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

No branches or pull requests

2 participants