-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try: Polish block menu and show only fills when available. #28486
Conversation
Size Change: +72 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
packages/block-editor/src/components/block-settings-menu-controls/index.js
Outdated
Show resolved
Hide resolved
…ols/index.js Co-authored-by: Greg Ziółkowski <[email protected]>
return ( | ||
<MenuGroup> | ||
{ fills } | ||
<ConvertToGroupButton |
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.
Question, this Convert to Group button is now wrapped in the same fills?.length
condition. Is that appropriate?
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.
I missed that to be honest. It will require some tweaks. @ntsekouras, can you help? This convert to buttons part is also optional 🙃
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.
I figured it might be tricky 🙈 — that's why I kept this in a draft state. But hopefully this will get the ball rolling, because the empty menu group is not great, I imagine for screenreaders either.
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.
It might be fine with screenreaders since there are no focusable items inside the group. I speculate though. It's an issue that can be and should be addressed 😄
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.
I created a new hook for this here: 7429243
</MenuItem> | ||
</> | ||
) } | ||
{ ! isLocked && ( | ||
<MenuItem | ||
onClick={ flow( onClose, onMoveTo ) } | ||
> | ||
{ __( 'Move To' ) } | ||
{ __( 'Move to' ) } |
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.
Finally. Thank you!
I guess it's ready, @ntsekouras can you confirm? |
@gziolo - Yes, I just wanted someone else to review my approach with the new hook :) |
If it works, then ship it. Ideally, we would use fills for every menu items in the group to have unified handling, but it creates the chicken and egg dilemma 😅 |
This draft PR does two things:
Number 2 needs a serious sanity check, while it works fine in this PR, I believe there's something about the logic that's off.
Before:
After: