Writing flow: add Shift+Arrow when selection is 'full' - #44727
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. |
mcsf
left a comment
There was a problem hiding this comment.
Works for me, thanks for the fix!
There was a problem hiding this comment.
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.
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.
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.
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