-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Editor: WritingFlow: Consider selection collapsed for Shift+Arrow at navigable edge #13638
Conversation
I'm struggling to understand why the end-to-end tests are failing in Travis. The full suite passes for me when run locally. |
70381ad
to
e059151
Compare
e059151
to
67b1254
Compare
67b1254
to
f8d6e16
Compare
I discovered the reason for this being attributable to the fact that Shift+ArrowUp with an uncollapsed selection in the first line of text behaves differently in Mac Chrome than it does anywhere else (including Linux Chrome as tested by Travis). (Animation shows Shift+ArrowUp in Mac Chrome on the left, Windows Chrome on the right) It means I need to rethink the behavior changes, since Shift+ArrowUp shouldn't just collapse an uncollapsed selection, it may need to trigger a multi-selection to the previous block if the uncollapsed selection occurs entirely within the first line of a paragraph. |
Closing in favor of #14450 |
Closes #6164
This pull request seeks to resolve an issue with Shift+Arrow behavior of non-collapsed selections. Specifically, when a user selects text while holding Shift and pressing arrow keys, proceeding to press the reverse of those arrow keys while continuing to hold Shift should progressively collapse the selection.
Implementation notes:
I had considered trying to incorporate this into the logic of
isVerticalEdge
andisHorizontalEdge
from thedom
module, but it relies on "is Shift held" as a condition to be known, which is made available only by the event handled withinWritingFlow
. Optionally, it could also be considered to pass as an argument.Testing instructions:
Verify the intended fix, that selecting text in a particular direction should inherit browser behavior when that is followed by arrow keys in the reverse direction of the selection.
(It may help to reference the included end-to-end tests to explain the behavior)
Verify expected behavior with WritingFlow continues to work, particularly: