Editor: WritingFlow: Consider selection collapsed for Shift+Arrow at navigable edge #13638
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.

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
isVerticalEdgeandisHorizontalEdgefrom thedommodule, 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: