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

3.7.15 • 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');

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

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

    Weekly Downloads

    9,010

    Version

    3.7.15

    License

    Apache-2.0

    Unpacked Size

    44 kB

    Total Files

    11

    Last publish

    Collaborators

    • devongovett
    • aspro83