makeup-screenreader-trap
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/makeup-screenreader-trap package

0.4.1 • Public • Published

makeup-screenreader-trap

This module restricts screen reader virtual cursor to a single subtree in the DOM. This behaviour is useful when implementing a modal interface (e.g. a modal dialog).

import * as screenreaderTrap from 'makeup-screenreader-trap';

// trap an element
screenreaderTrap.trap(document.querySelector('el'));

// untrap the current trapped element
screenreaderTrap.untrap();

Experimental

This module is still in an experimental state, until it reaches v1 you must consider all minor releases as breaking changes.

Options

  • useHiddenProperty: use hidden property instead of aria-hidden (default: false)

Events

  • screenreaderTrap : fired by trapped element when screenreader trap is activated
  • screenreaderUntrap : fired by trapped element when screenreader trap is deactivated

Package Sidebar

Install

npm i makeup-screenreader-trap

Weekly Downloads

6,992

Version

0.4.1

License

MIT

Unpacked Size

15.2 kB

Total Files

8

Last publish

Collaborators

  • saiponnada
  • lulavalva
  • artblue
  • dylanpiercey
  • sendlo
  • ianmcburnie
  • agliga