Popover with mouse over interaction needs more specific instruction or a pointer event control property in the api #26753
Labels
component: Popover
The React component.
status: expected behavior
Does not imply the behavior is intended. Just that we know about it and can't work around it
At the moment, when you need a hovering popover solution in MUI, you have to set
onMouseEnter
handler for updating anchor element, andonMouseLeave
for setting anchor element tonull
, the problem is you must set the popover css stylepointer-events
asnone
, otherwise when you're hovering an element, the anchor element will be set to this element and then it will immediately triggeronMouseLeave
, and the anchor element will be set intonull
, the popover won't show up ever. The doc just puts some code example in there and doesn't say very clearly about it. It's a very tricky bug when using Popover with hovering.Current Behavior 😯
Popover component with hovering must set its css style
pointer-events
intonone
, otherwiseonMouseLeave
will trigger immediately, and popover won't show up, and the doc didn't make it very clear.Expected Behavior 🤔
Provide a property in
Popover
api for controllingpointer-events
, at least make it clear in the doc to let us know we must changepointer-events
intonone
when using Popover with hovering.Steps to Reproduce 🕹
Here's CodeSandbox Demo
Steps:
onMouseEnter
andonMouseLeave
pointer-events
tonone
, keep it defaultYour Environment 🌎
The text was updated successfully, but these errors were encountered: