infinite open→close→open→close when trying to trigger dropdown on hover #3155
Unanswered
BorisTheTripper
asked this question in
Help
Replies: 1 comment
-
This behavior is because Radix UI's dropdown menu by default treats the dropdown content as a modal, disabling pointer events on body when opened (causing You'll need to wrap everything in a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to define a dropdown that is triggered on hover (
mouseenter
&mouseleave
) instead of on click. However, when I hover over a trigger, it just creates an infinite event cycle ofmouseenter
, immediately followed bymouseleave
, and going in circles ad infinitum. I suppose that changing the state causes the component to re-render, unmounting the previous trigger and firingmouseleave
again.I understand that this is more of a React question than a Radix question, but I thought I might get quality feedback here too. What might be a quick solution to this problem?
Beta Was this translation helpful? Give feedback.
All reactions