-
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
Writing flow: add Shift+Arrow when selection is 'full' #44727
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: +161 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
cabae08
to
ddb5a4b
Compare
Flaky tests detected in 6fd8c8a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4532738423
|
ddb5a4b
to
6fd8c8a
Compare
This is a pretty bad issue, I think it's maybe worth back porting to a minor release. |
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.
Works for me, thanks for the fix!
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.
Should we use store/private-selectors.js instead?
export function __unstableIsBlockMergeable( state, clientId ) { | ||
const blockName = getBlockName( state, clientId ); | ||
const blockType = getBlockType( blockName ); | ||
return !! blockType.merge; |
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 only way for blockType
to be empty is if the selector is called with a bogus clientId
, but it doesn't hurt to be defensive:
return !! blockType.merge; | |
return !! blockType?.merge; |
@@ -199,8 +203,9 @@ function RichTextWrapper( | |||
// is a parent block. |
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 comment here only mentions start
and end
, so it might need an update to reflect mergeability but also the block root condition.
scrollIntoView( | ||
node.ownerDocument.getElementById( | ||
`block-${ nextSelectionEndClientId }` | ||
), |
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.
Not a concern for this PR, but ideally we wouldn't be passing around DOM IDs here, right? "Scroll me into view" should be a "method" available for blocks in general.
Warning: Type of PR label error To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. |
Removing the minor release label because this hasn't been worked on for a few months so it's not a 6.3 regression 😅 |
What?
When selection is "full" (not partial), Shift+Arrow Up/Down should expand selection block by block.
Why?
Currently Shift+Arrow doesn't work at all.
How?
Testing Instructions
Select across two blocks that can't be merged, for example the list block and paragraph block. Try to expand selection with the keyboard (Shift+ArrowUp/Down).
Screenshots or screencast