-
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
Template actions with DropDownMenuV2 #51043
Conversation
Size Change: +47 B (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
Flaky tests detected in be357c90e5c0442472ed5e92e71a4a5b8f837ca6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5110234176
|
Thank you Nik, you anticipated my next move! I'll try to have a look at this PR today/tomorrow. Just a head-up that you may want to rebase this PR after #51046 lands, which should align the behavior of |
Glad to hear!
Absolutely, I'm planning on working on that very soon (edit: opened #51097) |
be357c9
to
178e7e1
Compare
@@ -64,14 +68,14 @@ export default function RenameMenuItem( { template, onClose } ) { | |||
|
|||
return ( | |||
<> | |||
<MenuItem | |||
<UsedComponent | |||
onClick={ () => { |
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'm not sure if onClick
works at this point on DropdownMenuItemV2
— you may need to use onSelect
instead (here and everywhere else in the PR)
export default function RenameMenuItem( { | ||
template, | ||
onClose, | ||
as: UsedComponent = MenuItem, |
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.
Any reason why we're not using DropdownMenuItemV2
directly here?
) } | ||
{ isRevertable && ( | ||
<DropdownMenuItemV2 | ||
info={ __( |
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.
DropdownMenuItemV2
doesn't expose an info
prop — you'll have to use children
and add/style that text separately
What?
This is a real quick draft PR to start exploring the integration of DropDownMenuV2(see component's main issue). It's related to this issue, but I'll probably implement it with the current DropDown because we're close to 6.3 deadlines.
I'm happy to iterate on this to start pinpointing what's missing.
Testing Instructions
Templates
in site editor navigation sidebar select a custom created templaterename/delete/
optionsThings noticed so far
Rename
item on click opens a Modal, but here we close the DropDown, so we cannot render it. We need to check the focus handling and what would be the best way to handle these use cases.