-
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
Fix multiselecting blocks using shift + arrow #11237
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,12 @@ export class BlockListBlock extends Component { | |
if ( this.props.isSelected && ! prevProps.isSelected ) { | ||
this.focusTabbable( true ); | ||
} | ||
|
||
// When triggering a multi-selection, | ||
// move the focus to the wrapper of the first selected block. | ||
if ( this.props.isFirstMultiSelected && ! prevProps.isFirstMultiSelected ) { | ||
this.wrapperNode.focus(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this something which is meant to occur instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's meant to occur instead of I'm not sure about the assertive technologies though, it's very tied with multi-selection, not sure how multi-selection is announced. |
||
} | ||
} | ||
|
||
setBlockListRef( node ) { | ||
|
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.
These comments explain what we're doing (which is pretty plainly obvious in the implementation anyways) but not why. I don't know why we're doing this.
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.
We move the focus to ensure that it is not possible to continue editing the initially selected block. This happens for all active elements that allow editing like
RichText
,PlainText
and all form fields. This behavior ensures that you no longer can modify the content of the selected blocks.