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

Handling inner focus-traps #86

Closed wwahammy closed 5 years ago

wwahammy commented 5 years ago

I'm trying to wrap my head around focus-trap and modals. In particular, if you have a focus-trap inside your modal, you're supposed to set focusTrapPaused to true on the modal. I was considering creating a component to manage this situation but I want to make sure I understand it. Do you foresee any situation where someone WOULDN'T want to pause an outer focus-trap when an inner one is active?

davidtheclark commented 5 years ago

Hi @ericschultz. With the recent v4 nested focus traps should automatically pause: https://github.com/davidtheclark/react-aria-modal/blob/master/CHANGELOG.md#400. Does that solve your problem?

wwahammy commented 5 years ago

@davidtheclark I hadn't seen that! The README.md still says that you need to manually pause if you have a nested focus-trap so I assumed that was still true.

davidtheclark commented 5 years ago

Great, @ericschultz. I adjusted the docs in 9dd1bb05dd3f47a242db9a13ca86b4c63d2fb6f5.