How to interact with SelectField inside a Modal (React Aria v3.19.0) #8702
Unanswered
kguptaping
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Thanks for the issue, could you provide a codesandbox or stackblitz? It's hard to know what your setup is otherwise. I can say this works in React Aria Components which are built on our hooks, so it should work. You're welcome to look through those components to see what all we did as well. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm using React Aria v3.19.0 in a React project and have built several accessible components using hooks like:
useSelect (for SelectField)
useComboBox (for ComboBoxField)
useDialog (for Modal Component)
Everything works fine individually, but I run into a problem when I try to use SelectField or ComboBox inside a Modal.
🐞 Issue:
When I open a Modal and try to interact with a Select or ComboBox inside it, the dropdowns or popovers become uninteractive / unclickable.
I inspected the DOM and found that the div element with data-overlay-container="true" is rendered outside the Modal overlay and has the inert attribute applied to it when the modal is open. This seems to be blocking interaction with the dropdowns.
React Aria marks the rest of the app as inert when the Modal is active (for accessibility), so anything outside the Modal — including overlays — becomes non-interactive.
❓ Question:
How can I properly render interactive SelectFields or ComboBoxes inside a Modal, so that their dropdowns remain interactive and accessible?
Is there a recommended pattern or fix for this?
✅ What I've Tried:
Wrapping the entire app with
Using a separate inside the Modal
Using explicitly inside the Modal content
Any guidance or best practices from the React Aria team or others who’ve faced this would be appreciated!
Thanks in advance 🙏
Beta Was this translation helpful? Give feedback.
All reactions