humaan / Modaal

An accessible dialog window library for all humans.
http://humaan.com/modaal/
MIT License
2.72k stars 183 forks source link

Send focus to more semantic element on open #50

Closed marcysutton closed 8 years ago

marcysutton commented 8 years ago

The modal has focus management but when it opens, nothing is announced in Voiceover. If you send focus instead to the element with role="dialog" and an aria-label, those will be announced when the dialog opens. Or you could send focus to the close button–I've heard of people doing it either way.

Here is a screenshot showing the wrapping dialog and DIV inside with tabindex="0":

Dialog with browser dev tools open onto DOM

You could move tabindex to the dialog element and change its value to -1, that way it won't be in the explicit tab order.

danhumaan commented 8 years ago

Hi @marcysutton firstly, thanks for taking the time to review this and raise the issue. I've flagged this ticket as a bug and assigned it to our next milestone so we can get it looked at, and a fix rolled out as soon as possible.

danhumaan commented 8 years ago

Hi @marcysutton, thanks again for your contribution. A fix has been just been rolled out in the latest release for this issue.