Setting the tabindex of the underlay element of a modal dialog (Comment 418)

Document: WAI-ARIA 1.0 Authoring Practices Working Draft 7 March 2013
Part: 3.3. Making a Dialog Modal (modal_dialog)

"Set the tabindex of the underlay element to tabindex="-1" to prevent it from receiving focus via a keyboard event or mouse click."

If you set tabindex=-1, the element can not be tabbed to, but it will receive focus on mouse click. This is correctly stated in the table http://www.w3.org/TR/2013/WD-wai-aria-practices-20130307/#focus_tabindex

You can also see it here: http://www.mescripts.net/mescripts/tests/testfocus.html (see the triggered onfocus in the javascript console)

Proposal:

No resolution, but just thoughts:
Normally you would just use a container element such as DIV for the underlay element, so there is no need to set the tabindex.
If you set tabindex=-1 handle the onfocus-event and ???
- reset the focus to the previously focused element (requires saving the focused element)
- set the focus like when opening the dialog (first focusable element or closing-element)
- ? 

Received on Friday, 19 April 2013 16:40:35 UTC