googlearchive / core-overlay

A custom element that renders on top of other content.
6 stars 20 forks source link

Should focus first focusable child #63

Closed robdodson closed 9 years ago

robdodson commented 9 years ago

When a core-overlay is opened, focus should be moved to the first focusable child within the overlay. This is to prevent screen readers from interacting with background content.

ex: http://accessibility.oit.ncsu.edu/training/aria/modal-window/

robdodson commented 9 years ago

Even better explanation: https://www.marcozehe.de/2015/02/05/advanced-aria-tip-2-accessible-modal-dialogs/

edit

It would be nice if the core-overlay could trap the tab key so users don't have to write their own tab handlers. Also if it provided an escape key listener as a exit, that would be good too. This is all explained in the article mentioned above.

robdodson commented 9 years ago

Derp, it helps to RTFM! It looks like this is covered by the autofocus attribute. I'll open a separate ticket for trapping tab.