[Webkit-unassigned] [Bug 236322] New: Dialog's "previously focused element" and focus-visible

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 8 12:48:20 PST 2022


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

            Bug ID: 236322
           Summary: Dialog's "previously focused element" and
                    focus-visible
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Mac (Intel)
                OS: macOS 12
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: darin.senneff at gmail.com

When closing a <dialog> element, focus is only moved back to the "previously focused element" if a keyboard was used to initially show the dialog. I'm assuming this has to do with the focus-visible algorithm, as a click doesn't normally put visible focus on a button. 

But because the <dialog> autofocuses a button upon being opened, it's possible users will then use the keyboard to close the modal rather than click – by pressing the ENTER, SPACE, or ESC keys. In these cases where the user has changed their input method from click/tap to keyboard, should the previous element now receive focus? 

I think regardless of the input method used to close a modal, focus should be placed on the previous element to help re-orient the user. But at minimum I think it should in cases where a keyboard was used to close the <dialog>.

Looking at the spec's dialog focusing steps, this edge case seems beyond that. But think there's value in it.

-- 
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/20220208/6b6a1a69/attachment-0001.htm>


More information about the webkit-unassigned mailing list