-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NavigationMenu] Menu closes when mouseenter + instantaneous click #2326
Comments
Duplicate of this issue: There's a hacky fix in that thread. |
Oh thanks for the context, it's the same underlying issue indeed. I don't want to disable hover, both should trigger the menu. |
It doesn't disable hover just disables clicks for 1 seconds after hover. https://codesandbox.io/p/sandbox/peaceful-nobel-gmlbyy?file=%2FApp.tsx |
Thanks, I refactored it to this workaround for now: function Item () {
const fix = useTriggerFix()
...
<NavigationMenu.Trigger {...fix}>
...
}
function useTriggerFix() {
return useMemo(() => {
let disable
return {
onClick: (e) => disable && e.preventDefault(),
onPointerEnter: () => {
clearTimeout(disable)
disable = setTimeout(() => (disable = false), 1000)
},
}
}, [])
} |
Yeah seems like it’s a duplicate of #1630. A workaround can be found here: #1630 (comment). |
Duplicate of #1630 |
Bug report
Current Behavior
Expected behavior
Reproducible example
https://www.radix-ui.com/docs/primitives/components/navigation-menu
Suggested solution
The initial delay that "ignores" the first toggle, should be re-applied when a new menu item is opened.
Additional context
Your environment
The text was updated successfully, but these errors were encountered: