-
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
Navigation: Move add a submenu option to the top of the list #46076
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
@@ -226,6 +226,8 @@ export function BlockSettingsDropdown( { | |||
<__unstableBlockSettingsMenuFirstItem.Slot | |||
fillProps={ { onClose } } | |||
/> | |||
</MenuGroup> | |||
<MenuGroup> |
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 means all items added using __unstableBlockSettingsMenuFirstItem
will be in a MenuGroup.
> | ||
{ __( 'Add a submenu item' ) } | ||
</MenuItem> | ||
<__unstableBlockSettingsMenuFirstItem> |
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 is the only change here. The rest is indentation.
Size Change: +14 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
> | ||
{ __( 'Add a submenu item' ) } | ||
</MenuItem> | ||
<__unstableBlockSettingsMenuFirstItem> |
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.
Won't this mean that Add a submenu shows for all block types?
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.
Oh I see. Might as well close this then!
This approach doesn't work. |
What?
Moves the "Add a submenu" option to the top of the block settings dropdown. Also add a line beneath it.
Why?
This is a primary action so it should be at the top of the list.
How?
Using
__unstableBlockSettingsMenuFirstItem
. This also wraps__unstableBlockSettingsMenuFirstItem
in aMenuGroup
which adds a line beneath it, but this has the unfortunate consequence that any items added using__unstableBlockSettingsMenuFirstItem
will also be in a different group.We might also want to remove the "Hide more settings" option. I started doing that here: #46077
Testing Instructions
...
next to the custom linkScreenshots or screencast