-
Notifications
You must be signed in to change notification settings - Fork 199
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
Add toolbar dropdown component for use with blocks #3904
Conversation
Does this differ significantly from the |
Not well-documented but |
Did a bit of investigation on how this page is generated and after ending up on this comment it seems that the actual Gutenberg version that is included on each WP version is the latest one. Not sure what is the reason for including earlier versions in a range. Previously I thought that for Wordpress 5.4 we needed to support Gutenberg v6.6.0 (which does not include On another note, a text argument was also added in |
Nice! For a text button in the toolbar, I used ToolbarGroup's |
1fa0f6e
to
3154c0c
Compare
Thank you for checking and for the suggestions! I tried to implement it using the
The same happens with the I just replaced the Button in the list with |
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 am going to start using this in the restricted content block. Left a minor comment that came up while using it.
* @param {string} [props.optionsLabel] Options label. | ||
* @param {Object} props.icon Icon for the toolbar. | ||
* @param {string} props.value Current value. | ||
* @param {Function} props.onChange Change function. |
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 think that the arguments are a bit generic and the documentation don't specify what they actually do.
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.
Do you think this change is enough? 6a94e1e
const selectedOption = options.find( ( option ) => value === option.value ); | ||
|
||
return ( | ||
<Dropdown |
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.
Should we change the border to have a block color as the rest of the dropdown menus?
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.
Good catch! Fixed here: bbdf53c
So it gets the correct border style
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.
LGTM!
Changes proposed in this Pull Request
Testing instructions
You can test that in the
add/lesson-actions-preview
WIP branch.Screenshot / Video
Screen.Recording.2021-01-18.at.17.31.42.mov