[Webkit-unassigned] [Bug 112968] FKA: mouse click on buttons causes focus (document.activeElement) to be lost

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 12 03:43:27 PDT 2023


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

--- Comment #10 from Mu-An Chiou <me at muanchiou.com> ---
Just talked about this at TPAC with ntim and jcraig I just want to add to the repro steps:

REPRO *
1. Load attached test case.
2. Tab so that focus is on one of the buttons.
3. Perform a mouse click on the same button. (Notice focus ring disappears.)
4. Press Tab again. (focus has been lost and resets to the beginning of the document)

As of 16.6, step 4 is no longer the case. the next focus point does land on the button. However if you do `setInterval(() => console.log(document.activeElement), 1000)` to observe the current focused element, you would see that after step 3, the activeElement goes back to body.

nTim mentioned that there has been a recent fix to account for how button[tabindex=0] should be click-focusable like div[tabindex=0]. https://github.com/WebKit/WebKit/pull/12743

Now that :focus-visible is implemented, I wonder if WebKit would mind reconsidering this special treatment (https://github.com/WebKit/WebKit/blob/b38121da42a0483fdb1bc13782f1c7a8059de100/Source/WebCore/html/HTMLFormControlElement.cpp#L255C13-L255C13) to buttons?

-- 
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/20230912/01c6b179/attachment.htm>


More information about the webkit-unassigned mailing list