Menu component in dialog #5287
-
Is it OK to use the RAC |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
I wouldn't put the Menu inside a Dialog in order to create a Tray. Instead, I'd direct you to this section of our docs https://react-spectrum.adobe.com/react-aria/Popover.html#features where the last sentence says
So I'd use Popover and just style it like a tray. You can find some sections on styling here: https://react-spectrum.adobe.com/react-aria/Modal.html#custom-overlay While this example is also a Dialog, you can apply the same ideas. We also render our Menu as a tray on mobile in React Spectrum. You could have a look at how that has been implemented. |
Beta Was this translation helpful? Give feedback.
-
Sorry to dredge an existing ticket but I have this issue too. (For context, I'm back-porting We have a "menu" that was never really a menu, so I'm just using a dialog trigger with a popover. However, one of the 'inner' bits of the modal is really a menu: However, focus doesn't work properly as the dialog focus trap never allows the Menu to gain focus. I've tried disabling Screen.Recording.2024-06-19.at.17.17.15.movI guess one option would be to make the Back/Help buttons be part of the menu, or make none of the items menu items, but my preference for a11y would be that they are three distinct tab stops. Any help would be greatly appreciated 🙏 |
Beta Was this translation helpful? Give feedback.
Ah, yes, sorry, I went to the wrong page https://react-spectrum.adobe.com/react-aria/Modal.html#features has the same line. Modal makes more sense for a Tray without the positioning relative to another element.