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

[SuperEditor][Web] Fix option + arrow key selection changes (Resolves #2415) #2418

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

angelosilvestre
Copy link
Collaborator

[SuperEditor][Web] Fix option + arrow key selection changes. Resolves #2415

Steps to reproduce the behavior:

  1. Run Example app on Chrome
  2. Place cursor at beginning of line
  3. Use CMD + SHIFT + RIGHT ARROW to select until the end of line
  4. Use SHIFT + ALT + LEFT ARROW to remove last word from selection

When doing this the caret moves to the beginning of the line:

Screen.Recording.2024-11-19.at.11.37.40.AM.mov

This seems to be caused by IME deltas. I ran the example editor without any keyboard handlers and the issue also happens. It might be related to the same issue fixed in #2327, where the line breaks on the browser HTML input are different from Flutter.

Currently, we have a keyboard handler that sends the event back to the IME when pressing LEFT or RIGHT ARROW at the middle of the text. I modified this handler to not do that if ALT is pressed.

Screen.Recording.2024-11-20.at.18.58.37.mov

This PR adds tests for this, but to effectively test these web keyboard interactions we would need an integration test that runs on the browser.

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.

[BUG] - CMD+Arrow + Selection Change not working correctly
1 participant