Summary: | FKA: mouse click on buttons causes focus (document.activeElement) to be lost | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | James Craig <jcraig> | ||||
Component: | Accessibility | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED CONFIGURATION CHANGED | ||||||
Severity: | Normal | CC: | cfleizach, fotis.papadogeorgopoulos, gsnedders, jcraig, me, ntim, rego, webkit-bug-importer, webkit | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=22261 | ||||||
Attachments: |
|
Description
James Craig
2013-03-21 14:44:22 PDT
Created attachment 194349 [details]
test case demonstrating bug
See expected behavior in Firefox 19 for Mac. Any updates on this? I see that there's not been any changes since the bug was reported 5 years ago. This issue makes building custom widget with focus management very tricky. Relating to the newer :focus-visible tracker in bug 225148 Very related bug, see bug #229895. 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? Seems reasonable to me... When I filed this back in 2013, :focus-visible didn't exist so there wasn't a way to make this work for all use cases, but I think that wwide support of :focus-visible now unblocks this, right? Seems fixed in latest STP so this was probably resolved along with :focus-visible. Muan, if you know of other instances where this doesn't work, will you open a new issue? |