-
Notifications
You must be signed in to change notification settings - Fork 253
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
Conversation
@@ -523,6 +523,126 @@ void main() { | |||
), | |||
); | |||
}); | |||
|
|||
testWidgetsOnMacDesktopAndWeb('SHIFT + OPTION + LEFT ARROW: removes upstream word from selection', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The terms "upstream" and "downstream" are used incorrectly in this test name and the next. This test deselects the last word in the line - that's downstream. The other test deselects the first word in the line - that's upstream.
But we probably don't need to use those words at all. It's not obvious what they mean.
Instead we can say "SHIFT + OPTION + LEFT ARROW: deselects word at end of line after selecting the whole line from start to end"
and "SHIFT + OPTION + RIGHT ARROW: deselects word at start of line after selecting the whole line from end to start"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[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.