-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
[Popper] Support marginThreshold
prop like in Popover
#39
Comments
marginThreshold
prop like in Popover
Are we? Is there an issue about this? I thought the Popover was intended to be a high-level building block for popups, dialogs, select listboxes, etc. |
@michaldudak I have updated the description, great point. I'm not sure about "dialogs" though. I don't see how it would fit. The problems we need to consider:
I would imagine that the value of Popover is to remove the duplication for very frequent combination of the above. Dialog feels hyper specialized, it could directly compose these 4 components. What I see frequently needed is a slick way to display small element elements on the page, typically, it's always the same animation between Context Menu, Menu, Select, Dropdown, Combobox, Date Picker, Color Pickers, Data Grid pannel. Now, I think Popover source should be very simple, so developers can easily eject and built their own. |
mui/mui-x#10009 (comment) raises the question on what the default value for this prop should be. |
marginThreshold
prop like in PopovermarginThreshold
prop like in Popover
marginThreshold
prop like in PopovermarginThreshold
prop like in Popover
The new Popover (and other popover-like components) supports the https://master--base-ui.netlify.app/components/react-popover/ |
Nice 👍, 5px might be enough, we will see. I guess we don't need a demo for this. For the prop name, "padding" feels strange, it's more of a "margin"? |
Depends how you look at it, I guess - it's a padding of a collision box. Maybe margin would be a bit more intuitive though, it's hard to say. |
@michaldudak We should stick with |
@colmtuite Are people frequently using this prop? If not, we could argue that it's an opportunity to see what the optimal name could be. We could also have a deprecated prop with the Radix prop name (actually true for everything else) so it's super easy to migrate. Maybe to consider? Actually, could do the same with Material UI prop names. Idea moved to #601.
The initial proposal for not using 0 is that it seems to create confusing UIs: I'm not sure about the use cases for being right on the edges of the screen? |
Summary 💡
The Popper component is missing the equivalent of the marginThreshold prop of the Popover.
As we are trying to revamp the Popover component, I think we must port this feature back. We have seen in #413 and mui/mui-x#10009 that this prop matters, we can't get away without it.
Examples 🌈
Radix UI solves this with a custom
collisionPadding
prop on the Popper.Motivation 🔦
Great UX.
This also connects a bit with the effort to modernize the Popper component of mui/material-ui#32587 (comment).
cc @michaldudak
The text was updated successfully, but these errors were encountered: