Merged
Conversation
|
Size Change: +24 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
mtias
reviewed
Sep 12, 2022
packages/block-editor/src/components/writing-flow/use-arrow-nav.js
Outdated
Show resolved
Hide resolved
mcsf
approved these changes
Sep 13, 2022
Contributor
mcsf
left a comment
There was a problem hiding this comment.
Nice. :) (Do you know what's up with the tests?)
mtias
reviewed
Sep 17, 2022
| ).toHaveText( /^a+\.a$/ ); | ||
| } ); | ||
|
|
||
| test( 'should vertically move the caret when pressing Alt', async ( { |
Member
There was a problem hiding this comment.
These tests are providing a pretty good self-documentation of text interactions
Member
Author
|
I'm not sure why the added test is failing here but not locally. I'll have to remove some parts. |
ad9197c to
313ca77
Compare
Member
Author
|
I removed the testing of native behaviour for now so we can get this merged. |
Member
|
This is a cool one, thanks! |
38 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What?
Implements Alt+Arrow in writing flow. Currently the caret is placed as if Alt weren't pressed, at the closest edge of the next tabbable element. Instead, the caret should be placed at the furthest edge and also at the furthest horizontal position.
Why?
As a result, you can quickly press Alt+Arrow Up/Down to navigate blocks of text. This emulates Alt+Arrow Up/Down in normal text editors, where it normally navigates to the previous/next line break or text block.
How?
Changes the arguments passed to
placeCaretAtVerticalEdge.I didn't add behaviour to also stop at line breaks, as this is a bit more challenging. This change on its own should already be a huge improvement.
Testing Instructions
Screenshots or screencast