mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.43k stars 32.16k forks source link

[docs] Popover flip #42636

Open qIsotope opened 3 months ago

qIsotope commented 3 months ago

Related page

https://mui.com/material-ui/react-popover/

Kind of issue

Other

Issue description

Hello, do MUI have a possibility to add modifiers to Popover component? I wanna the same behaviour as Popper have, when dropdown have no space below the button it goes to top, and when no spacing top it goes bottom

Context

No response

Search keywords: Popover

mnajdova commented 3 months ago

I would recommend using the Popper component if you have this kind of use-case. You can use a Paper component inside to make it look similar as the Popover.

qIsotope commented 3 months ago

@mnajdova okay, but in this case window scroll will be enabled, do you have a possibility to disable him?

mnajdova commented 3 months ago

We don't have an API for it, but it should be easily doable on your side, e.g. check how the ModalManager implements this behavior: https://github.com/mui/material-ui/blob/next/packages/mui-base/src/unstable_useModal/ModalManager.ts#L130