I'm trying implement popover which shows on mouseEnter and hides on mouseLeave - using popover example template from http://www.material-ui.com/#/components/popover
The issue occurs onMouseEnter event, when I hover over then Button both mouseEnter and mouseLeave handlers are being called in sequence. That prevents Popover template to show up.
mouseEnter event -> mouseEnter handler + mouseLeave handler
When I move mouse off the button then just mouseLeave handler is called - as expected.
mouseLeave event -> mouseLeave handler
Reproducable link https://codesandbox.io/s/66nj8qRBR
This behavior is expected. The Popover has the modal behavior, meaning it blocks all interactions with the rest of the page. Prefer the Popper component in this case.
@oliviertassinari can you confirm that this is _actually_ the expected behavior. The @imornar said this, which doesn't make sense to me as an expected behavior.
mouseEnter event -> mouseEnter handler + mouseLeave handler
I'm seeing this as well. I would have expected the mouseEnter
event to only call the mouseEnter handler
, not the leave handler also.
@oliviertassinari how to we disable the popover backdrop over the page?
@resson-ntranquilla We will work on that in the future: #11243.
is there a solution to the above? (mouseEnter event + mouseLeave handler) firing at the same time when mouseEnter happens?
The Popover has the modal behavior, meaning it blocks all interactions with the rest of the page. Prefer the Popper
component in this case.
However, if you want to stick to the Popover anyway, there is workaround to fix it:
<Popover
style={{ pointerEvents: 'none'}}
...
Thank You @konradwww. This saved my life.
Most helpful comment
The Popover has the modal behavior, meaning it blocks all interactions with the rest of the page. Prefer the
Popper
component in this case.However, if you want to stick to the Popover anyway, there is workaround to fix it: