Closed ebidel closed 8 years ago
It seems like there are at least two techniques used to solve this problem.
Use a global focus manager, which is the case of this dialog example.
https://github.com/GoogleChrome/dialog-polyfill/blob/master/dialog-polyfill.js#L352 https://github.com/GoogleChrome/dialog-polyfill/blob/master/dialog-polyfill.js#L379-L389
<a tabindex="1" id="firstFocusableElement"></a>
<!-- html that the user can focus -->
<a tabindex="1" id="lastFocusableElement"></a>
This technique is very limited in terms of what tabindex
values are allowed, but better for composition than a global manager.
I can look into this issue, and see which one offers the best tradeoff.
Currently, you can tab into the underlying content below the backdrop when the drawer is open. Is it possible to prevent that by applying a combination of
tabindex="-1"
and/oraria-hidden="true"
on the backdrop content when the drawer opens?I noticed http://demo.agektmr.com/dialog/ implements this. Using a screen reader with the show modal dialog example does not read the content beneath and it does not let you tab out of the modal.