-
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
[Block Editor]: Fix block switcher label to take into account block variations #43309
Conversation
This seems like a nice little win (I'm presuming if you have the icons option enabled, the tooltip is also correct). Possibly/probably separate from this PR, but in text-only mode, it isn't useful for the tooltip to say the same as the main label, so ideally there isn't a tooltip when the label is the same. |
Size Change: -1 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
@@ -89,6 +87,10 @@ export const BlockSwitcherDropdownMenu = ( { clientIds, blocks } ) => { | |||
[ clientIds, blocks, blockInformation?.icon ] | |||
); | |||
|
|||
const blockTitle = useBlockDisplayTitle( { | |||
clientId: clientIds, |
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.
This needs to be tested with multiple blocks selected. Previously, it would use the name of the first block with:
const [ { name: firstBlockName } ] = blocks;
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.
You're right! I'll probably just have to pick the first one..
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.
Code changes look good 👍🏻
What?
Currently the block switcher has a tooltip that doesn't take into account the block's block variations to display the proper title. This is also visible when we change
show button text labels
from preferences. This PR fixes that.Testing Instructions
Youtube
block and hover over the block switcher icon.Youtube
instead ofembed
show button text labels
from preferencesBefore
before.mov
After
after.mov