Support for nested Menus #669
Replies: 19 comments 9 replies
|
Hey! Thank you for your suggestion! This is something we want to support, but I can't give you an ETA on this. |
|
+1 |
|
I think this would be rather easy to implement manually if you just provided a way to open a menu programmatically. As of now it can only be opened by clicking on Menu.Button. Just provide an |
|
any updates on this ? |
|
Is there any way to do this? |
|
Any update on this? I'm trying to implement a sidebar multi level menu? Are there any other alternatives? |
|
I'm also looking for this. |
|
I think this is now possible since 1.7.4. In this version, a close method has been exposed on the Menu which can be used to manually close the menu. I put a quick example together in a stackblitz: https://stackblitz.com/edit/react-ts-iuxwoh It's pretty crude, but you should get the idea. |
|
?` |
|
I put a quick example together in a stackblitz based on @vixducis's example: https://stackblitz.com/edit/react-ts-2gynxv?file=App.tsx |
|
Nesting a |
|
this feature would be awesome improvement for menu functionality! |
|
I would love have one :D |
|
This is horrible! I spent hours, trying everything I could think of to hack it to work, but the keyboard navigation breaks if you nest menus—you cannot focus the trigger button using keyboard navigation if it sits inside a parent menu. We just have to abandon healessui in our team… I loved it for the easy documentation but alas.😔 The examples from other people here are not of idiomatic submenus, they're primitive workarounds that break proper UX. |
|
@RobinMalfait Any chance we can get an update here? Looks like a lot of folks (myself included) are needing to move away from HeadlessUI because this feature is missing. |
|
Please +1 |
|
it's 5 years now ... |
|
+1 |
|
Here's the workaround for v2.X that I used for my project. I discovered that Menu, Listbox etc works inside Popover. So I'm using Popover for the parent menu. So Simply instead of Here's some example: https://stackblitz.com/edit/react-ts-2mc6rkdl?file=App.tsx I know this isn't the intended use and i might have broken some a11y (but visually & keyboard navigation seems to work fine). |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
This is somewhat related to #152
Are there any plans for supporting nested menus? My current use case is that when you select a menu item I need to re-render the list of items in the menu and show them without closing it. This is pretty straight forward but the issue is the menu closes on the first click.
I'm aware I can handle the open state manually but then I need to deal with handling outside clicks, etc. which is already managed by Headless UI.
All reactions