Reputation: 567
I can't get this behavior with Material-UI's Popover component.
I have this code example here: https://codesandbox.io/s/88z3nq96jl Steps to see the problem:
But I don't want to click twice when one of the popover is open, I'd need it to close the previous one and open the proper one at the same time.
I think the backdrop is stopping click events from propagating, so the filter behind it gets never clicked. Is there a way I can avoid that?
Upvotes: 10
Views: 14945
Reputation: 151
I'm using Material UI 4.11 and React 16.13.
You can set disableEnforceFocus to true (prevent the clicks from being blocked) and disable pointer events on the root css (allow clicks to pass through the backdrop).
const styles = makeStyles<Theme>((theme) => ({
popover: {
pointerEvents: "none",
},
}));
<Popover
classes={{ root: classes.popover}}
disableEnforceFocus={true}
>
</Popover>
Upvotes: 11