Controlling Menu component state for indirect open/closing #2862
-
Hey! I've got a question about a somewhat unorthodox use of the Essentially in my use case I'm implementing a bunch of keyboard shortcuts to do common actions in the UI, one of which involves switching user activity. Our The kicker is that I can't seem to get it all working nicely so that:
I've been playing around with and example in this sandbox: https://codesandbox.io/s/sweet-water-mn5rlf?file=/src/index.tsx but can't seem to quite get everything to work at once. Are there any suggestions for how else to achieve that functionality, or controlling the state of Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hey @oscar8880 ! I'm still discussing with the team, but could you share a design/prototype of the experience you're trying to achieve in the product? The additional context of where this interaction happens within Twilio could help us give some better pointers. Feel free to drop it in #help-design-system on slack if you don't want to share it here. |
Beta Was this translation helpful? Give feedback.
-
Hello @oscar8880! Thanks for sending us your examples. We're discussing it right now and will have something for you by the end of |
Beta Was this translation helpful? Give feedback.
-
Hi @oscar8880! Thank you so much for your patience. We used your CodeSandbox as the basis for our own working example in this one! Our Menu component is made through our Menu Primitive which repackages Reakit's menu, so their docs would be the best place to find details about controlling the menu state. We can use Two things to note about accessibility:
Let us know if that's helpful! |
Beta Was this translation helpful? Give feedback.
Hi @oscar8880! Thank you so much for your patience. We used your CodeSandbox as the basis for our own working example in this one!
Our Menu component is made through our Menu Primitive which repackages Reakit's menu, so their docs would be the best place to find details about controlling the menu state. We can use
toggle
within the menu state, for example, instead of creating a separate state for it opening and closing.Two things to note about accessibility: