Dialog Focus Trapping With Portals #2299
-
Assume I have a Select component inside a Dialog component, and both are rendered using portals. What is the best way to handle trapping focus within the modal while still being able to loop through the Select options using arrow keys when the dropdown is open? Seems like if the dropdown is rendered using a portal while inside a Dialog, the navigation accessibility features are disabled since focus is trapped within the Dialog. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We'll update the docs shortly. I recommend avoiding using a portal within the modal dialog because it traps focus. Removing the portal should make it work as expected. |
Beta Was this translation helpful? Give feedback.
We'll update the docs shortly. I recommend avoiding using a portal within the modal dialog because it traps focus.
Removing the portal should make it work as expected.