Skip to content
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

Focus block selection button only in navigation mode #60207

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ function BlockSelectionButton( { clientId, rootClientId } ) {

// Focus the breadcrumb in navigation mode.
useEffect( () => {
ref.current.focus();

speak( label );
}, [ label ] );
if ( editorMode === 'navigation' ) {
ref.current.focus();
speak( label );
}
}, [ label, editorMode ] );
Comment on lines +126 to +130
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure about this. It seems the core issue is that focusing this shouldn't automatically close the inserter. We're going to need to be able to have focus on the zoom-out mode toolbar and also stay in zoom-out mode. For example:

  • Insert a new pattern
  • Click on the revealed pattern toolbar to move the pattern up/down.
  • Pattern inserter is closed

const blockElement = useBlockElement( clientId );

const {
Expand Down
Loading