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.