react-spectrum
react-spectrum copied to clipboard
Is there nested menu support?
❔ Question
I've been looking for nested menu support both in Spectrum and Aria. No mentions found.
🔦 Context
Nested menus are as necessary as nested lists.
The foundation is present: https://react-spectrum.adobe.com/react-stately/useTreeData.html So theoretically is possible.
hi @osequi, nested menus are not supported yet, but it's something we absolutely plan to address down the line
hi, any news on nested menus? 😃
Hi guys, same question. Maybe someone can suggest at least a temporary workaround for this? It feels like its possible to use useTreeState for this, as it has an "expanded" keys collection. Is there a particular blocker why I won't be able to implement this using current functionality, even if it's not supported out of the box?
I think I need to implement a new type for nested data structure the same way as we have Item and section or even reuse menu itself, not sure how hard it can be :)
Any update on this?
Apologies about the delayed response, the team still hasn't picked up nested menus due to other component priorities. We're are also still waiting on some additional design/a11y support for certain facets of nested menu items. I honestly can't say whether or not useTreeState would be sufficient for an implementation of nest menus without trying it myself (my gut feeling is that it should be enough though).
For now you can reference https://github.com/adobe/react-spectrum/projects/1 to see what the team is currently working on.
Looks like @LFDanLu is currently working on nested menus. 🎉
https://github.com/orgs/adobe/projects/19/views/4?pane=issue&itemId=21692197
Hey, any updated on this?
Yep, you can follow the PRs https://github.com/adobe/react-spectrum/pull/5415 https://github.com/adobe/react-spectrum/pull/4976
they are getting to be close :)