-
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
Add popoverProps property to DropDown component #14867
Conversation
Is DropdownMenu something we want to be allowed to be shown without the arrow? It seems there's a stronger attachment between the popover and the invoking context than what exists with the Popover component alone. Is there some discussion or design which motivated this change? |
In #14851 (fc1fec7), I consider for the |
Thanks for the context. I agree that I could see this as a special variant of a dropdown, though it seems specifically tied to a combination of parts with the outline and arrow button surrounding the "Privacy" text, which makes me think:
I guess the fact that Popover already has this prop could be a reasonable argument in favor of just making it available. The alternative idea to pass through all non-explicitly-handled props to the Popover could work as well and has the advantage of not tacitly condoning it specifically, though in all I'm not really sure passing through props from Dropdown to Popover is something which would be expected from a consumer (at least by default, vs. something separate like Since there's already a precedent for listing out individual Popover props, I don't see it as necessarily troubling to change from how you've proposed. There's still an option in the future to change this behavior to the full "pass through" behavior. |
a3a6090
to
45d1abd
Compare
Hi @aduth I like the idea of having a popoverProps property that exposes popover props. I updated the code to follow this logic. |
45d1abd
to
b104f48
Compare
Given that some of the props are already propagated explicitly, we probably could re-consider it
Yes, it will also make documentation simpler as we would refer to the Popover documentation to learn about available props. At the moment we duplicate documentation for those props which are explicitly passed down. |
Description
The PopOver component had a property that allows disabling the arrow that appears with it. The DropDown component did not pass that property to the popover, this PR makes sure the DropDown component forwards this property.
How has this been tested?
I changed the DropDown component in packages/block-editor/src/components/block-switcher/index.js and verified the transforms menu did not contain the arrow.