-
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
Update dropdown-menu and button to allow text buttons #26425
Conversation
Size Change: +32 B (0%) Total Size: 1.21 MB
ℹ️ View Unchanged
|
b3da2c9
to
aafd939
Compare
Adds a new text property for button and dropdownmenu, if specified it will show the text in the button field. You could specify icon={ null } to have a text-only button. Used to support social links size menu in #25921
- Show text if specified regardless of icon, allows for icon & text - Switch text rendering, don't need a span tag, just use a fragment
aafd939
to
9cb4ebf
Compare
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.
The checks are passing 🤯 could it be !?
In any case, this is testing well for me:
That is ... we are not going to be adding that "More" label to the dropdown as shown in the screenshot here, that's just for testing.
Question: is there a better term than "text" for this property? Nothing comes to mind since label is already used, and serves as a tooltip/additional info.
Otherwise, seems good to me and just needs a code sanity check.
Description
In support of Social links size option (#25921) this PR adds the ability to show a dropdown-menu button with icon and/or text. Previously, you would need to create a custom control using the lower-level Dropdown component, for example the Replace image toolbar.
How has this been tested?
Confirm once applied nothing changes in existing DropdownMenus
Alter a DropdownMenu component being used to include the additional text prop
For example, update
packages/block-editor/src/components/rich-text/format-toolbar/index.js
and add a text prop, for example:You can test text-only buttons by setting
icon={ null }
Screenshots
Types of changes
Checklist: