adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
13.04k stars 1.13k forks source link

Consolidate aria-modal-polyfill with ariaHideOutside #1693

Open Andarist opened 3 years ago

Andarist commented 3 years ago

🙋 Feature Request

Consolidate the logic of @react-aria/aria-modal-polyfill and ariaHideOutside

🤔 Expected Behavior

The overlap between those 2 seems to be pretty huge - so the expected result would be the decreased bundlesize when using both.

In addition to that - it seems to me that what ariaHideOutside is solving (watching for new elements to hide while already active) is also important for the @react-aria/aria-modal-polyfill.

😯 Current Behavior

The concern of managing aria-hidden is heavily duplicated in both of those places and @react-aria/aria-modal-polyfill doesn't handle correctly a situation when a modal is active and a new element gets rendered outside of aria-hidden elements.

LFDanLu commented 3 years ago

Context for posterity: followup from https://github.com/adobe/react-spectrum/pull/1680.