You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reset focus when closing a dialog with no previously focused element #13118
The close-the-dialog algorithm restores previously focused element if non-null, but does nothing with focus when it is null. If focus is inside the dialog when it closes, this leaves the focused area inside a closed dialog until the asynchronous focus fixup rule runs. In the meantime, keyboard events can be lost because the active element is no longer focusable.
Chromium, Firefox, and WebKit all leave the input active immediately after close(), then change document.activeElement to body later. A Chromium change adds a synchronous regression test for this case.
Could the dialog-close steps run the focusing steps for the document's viewport when previously focused element is null and the focused area's DOM anchor is a shadow-including inclusive descendant of the dialog? This uses the existing focus model rather than introducing a separate notion of "clearing" focus, and preserves focus when it has already moved elsewhere.
Activity