[whatwg] Modal Dialog Focus

Scott González scott.gonzalez at gmail.com
Mon Oct 22 07:02:26 PDT 2012

The dialog.showModal() function defines steps for setting focus [1].
However, if the dialog does not contain any elements with the autofocus
attribute, then step 9 says to abort the steps and not set focus. It seems
problematic if the dialog is modal and does not have focus. How would a
keyboard user interact with the dialog? How would a screen reader know that
the dialog has been shown?

I would expect the control element to fall back to the first tab focusable
element if no element with autofocus exists. If there is still no control
element, I would expect the dialog itself to receive focus.

ARIA requires the element to contain at least one tab focusable element [2].

[2] http://www.w3.org/WAI/PF/aria-practices/#modal_dialog

More information about the whatwg mailing list