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

Disable focusTrap on `AriaModal` #101

Open nijynot opened 4 years ago

nijynot commented 4 years ago

There's to no option to disable the focus-trap on the modal. There's the focusTrapPaused, but that only pauses it, doesn't deactivate.

chaddjohnson commented 4 years ago

It definitely would be useful to have a way to disable the focus trap. Maybe something simple like this:

focusTrapOptions={{
  active: false
}}

or

focusTrapActive={false}

One use case is a designer mode where a preview of a modal, using react-aria-modal, is displayed on page. In this case, a focus trap would be undesirable.

UPDATE: Added a pull request.