-
I am trying to implement a Toolbar with Menu using react-aria where you can have multiple menus and you can quickly navigate through them using right/left arrows. Something similar to https://www.radix-ui.com/docs/primitives/components/menubar where the focus stays on the trigger even after open the menu. The focus only shifts after we click on the up/down arrow keys. Here's what I have so far: Kapture.2023-05-01.at.21.42.46.mp4As you can see, I am using useMenuTriggerState's |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I don't think we've implemented this pattern yet, it's a menubar https://www.w3.org/WAI/ARIA/apg/patterns/menubar/examples/menubar-editor/ Menu bars still use menus inside them, so you could probably get most of it implemented using our hooks, but some things you'd need to handle yourself. Could open a feature request for the menubar in React Aria and given that the behaviors and dom structure are well defined, you could contribute that if you wanted. Keep in mind that due to ongoing team priorities we won't have much time to actively support a contribution of this scale, but we'd appreciate any findings and progress you make here! |
Beta Was this translation helpful? Give feedback.
Yes I think it's the popover that has focus. I realised that I can actually fake this behaviour by pretending that the menu trigger button is focused using CSS. So even though it's not focused I can style it to look like it does and add interactions using JS.
Kapture.2023-05-02.at.01.22.05.mp4
Thanks a lot for your help. I think I have achieved the most of what I wanted using existing APIs of react-aria.