unovue / radix-vue

Vue port of Radix UI Primitives. An open-source UI component library for building high-quality, accessible design systems and web apps.
https://radix-vue.com
MIT License
3.48k stars 214 forks source link

[Feature]: Improve NavigationMenu behavior for click-based triggers #1304

Open blesildaramirez opened 3 weeks ago

blesildaramirez commented 3 weeks ago

Describe the feature

Currently, the disableHoverTrigger prop allows toggling the hover trigger for the NavigationMenu, which works as expected. When set to true, the menu will activate only on click. However, if the user loses focus or moves the cursor away from the submenu items, the menu closes immediately. I propose keeping the submenu visible until the parent menu is clicked again, providing a more consistent and user-friendly experience.

Additional information

zernonia commented 3 weeks ago

Hi @blesildaramirez ! When you mentioned submenu you mean the item inside <NavigationMenuContent />? Perhaps similar to https://github.com/radix-vue/radix-vue/issues/1315 ? 😁

blesildaramirez commented 3 weeks ago

Hi @zernonia , you're right. It's the <NavigationMenuContent />. And yes it's similar to #1315, although my request is to only close the NavigationMenuContent when the NavigationMenuTrigger is clicked again, similar to how clicking it displays the NavigationMenuContent when disableHoverTrigger=true.