-
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
Block Setttings Menu Controls: Add unstableDisplayLocation prop. #43987
Conversation
Size Change: +2.03 kB (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
packages/block-editor/src/components/block-settings-menu-controls/README.md
Outdated
Show resolved
Hide resolved
packages/block-editor/src/components/block-settings-menu-controls/index.js
Outdated
Show resolved
Hide resolved
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.
A few nits, but LGTM
Co-authored-by: Ben Dwyer <[email protected]>
packages/block-editor/src/components/block-settings-menu-controls/index.js
Outdated
Show resolved
Hide resolved
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.
Are we sure we want to name this context
? Seems to be overused lately and also a bit confusing in a React tree. I may be missing something here :/
I think that's a fair point. Any alternative ideas come to mind? |
@draganescu Now renamed to |
@draganescu Now |
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.
In this shape I feel more confident to 🚢 it 👍🏻
👋 I came across this API( |
Whilst I can't remember the full context, I am planning to work on #42605 (of which this was a spin off PR) so it's likely needed. Happy to deprecate/remove it if I find out it's not required. |
What?
Spin off from/sub PR of #42605.
Adds a
context
displayLocation
prop to the<BlockSettingsDropdown>
and then on to the<BlockSettingsMenuControls>
Slot.Why?
This affords the ability to contextually apply functionality inside the "3 dots" menu controls.
For example in #42605 we only wish to expose the
Rename
menu item inside the list view. Thecontext
displayLocation
prop affords this ability.How?
Adds a
context
displayLocation
prop to the<BlockSettingsDropdown>
and then on to the<BlockSettingsMenuControls>
Slot.Testing Instructions
See #42605
Screenshots or screencast