NEW251425
Unexpected focus-within behaviour when layout is forced during blur event
https://bugs.webkit.org/show_bug.cgi?id=251425
Summary Unexpected focus-within behaviour when layout is forced during blur event
Bastien Caudan
Reported 2023-01-31 01:31:23 PST
On a case where an element visibility is conditioned by a :focus-within pseudo class: <style> .dropdown .dropdown-content { visibility: hidden; } .dropdown:focus-within .dropdown-content { visibility: visible; } </style> <div class="dropdown"> <label tabindex="0">Click</label> <ul tabindex="0" class="dropdown-content"> <li><a href="#foo">Go to foo</a></li> <li><a href="#bar">Go to bar</a></li> </ul> </div> When switching the focus to an inner element (clicking on one of the links) with a forced layout during the blur event, the inner element is not focused. Without the forced layout on the blur event it behaves as expected. I have setup a reproduction case here: https://codesandbox.io/s/stupefied-andras-p79o0x?file=/index.html Other browsers seem to handle this case without issue.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-02-07 01:32:17 PST
Note You need to log in before you can comment on or make changes to this bug.