davidtheclark / react-aria-modal

A fully accessible React modal built according WAI-ARIA Authoring Practices
http://davidtheclark.github.io/react-aria-modal/demo/
MIT License
1.03k stars 96 forks source link

Added option, `focusTrapActive`, to allow disabling the focus trap. #103

Closed chaddjohnson closed 2 years ago

chaddjohnson commented 4 years ago

Per https://github.com/davidtheclark/react-aria-modal/issues/101, I've added an option to disable the focus trap. Please consider merging this into mainstream. Thanks!

chaddjohnson commented 4 years ago

@nijynot Thanks. Is there anything else I need to do to get this merged into master?

resource11 commented 3 years ago

Circling back here... One of the key tenets of an accessible modal is trapping focus inside the modal when it is open. I'm concerned that adding this feature in will create a plethora of inaccessible modals out there... :)

Here's a great article on accessible modals by Ire Aderinokun that describes the concept very well.

marlomgirardi commented 2 years ago

One of the project goals is accessibility, as @resource11 said, focus trap in a modal is a must-have.

chaddjohnson commented 2 years ago

Circling back here... One of the key tenets of an accessible modal is trapping focus inside the modal when it is open. I'm concerned that adding this feature in will create a plethora of inaccessible modals out there... :)

Here's a great article on accessible modals by Ire Aderinokun that describes the concept very well.

There are valid use cases for disabling focus traps. For example, in my app, a modal is placed inline in a page in design mode (the user is designing a modal). In this case, no interaction with the modal takes place.