@react-aria/aria-modal-polyfill
TypeScript icon, indicating that this package has built-in type declarations

3.7.8 • Public • Published

@react-aria/aria-modal-polyfill

This package is part of react-spectrum. Certain browser + screen reader combinations do not implement aria-modal correctly, allowing users to navigate outside of the modal. This package watches a container for aria-modal nodes and hides the rest of the dom from screen readers when one is open use the aria-hidden package.

How to use

Include this once in your application at the top level before modals are rendered.

import {watchModals} from '@react-aria/aria-modal-polyfill';
watchModals();

You can also pass it a selector string, by default it will watch body, which is where most applications should have their provider.

watchModals('.my-modal-root');

Readme

Keywords

none

Package Sidebar

Install

npm i @react-aria/aria-modal-polyfill

Weekly Downloads

6,322

Version

3.7.8

License

Apache-2.0

Unpacked Size

43.8 kB

Total Files

11

Last publish

Collaborators

  • devongovett
  • aspro83