[Webkit-unassigned] [Bug 236585] Safari moves focus to first focusable element inside an element with role="dialog" and aria-modal="true" when added to the DOM

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 5 17:21:24 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=236585

Tyler Wilcock <tyler_w at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tyler_w at apple.com

--- Comment #2 from Tyler Wilcock <tyler_w at apple.com> ---
Thanks for the bug report!

It's implemented this way due to this language in the aria-modal spec (though WebKit's autofocus behavior will currently also apply to <dialog>):

https://w3c.github.io/aria/#aria-modal

> When a modal element is displayed, assistive technologies SHOULD navigate to the element unless focus has explicitly been set elsewhere.

Technically, with that wording it should be VoiceOver (and other assistive technologies) doing this automatic focusing, but WebKit does this itself for now.

I do understand how this could be annoying when other browsers don't do this. And it would definitely be a bug if this autofocus behavior is trouncing explicit focus via JS or otherwise.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220506/f3b733d4/attachment.htm>


More information about the webkit-unassigned mailing list