[SuperEditor][Web] Fix option + arrow key selection changes (Resolves #2415) #2418
+122
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[SuperEditor][Web] Fix option + arrow key selection changes. Resolves #2415
Steps to reproduce the behavior:
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.