<label> element with tabindex attribute should become focused when element.focus() is called on it (and not forward focus to its control element)
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox76 | --- | fixed |
People
(Reporter: mail, Assigned: david.malcom.graham, Mentored)
References
()
Details
(4 keywords)
Attachments
(3 files)
Updated•9 years ago
|
Comment 1•9 years ago
|
||
Reporter | ||
Comment 2•9 years ago
|
||
Reporter | ||
Comment 3•9 years ago
|
||
Comment 4•9 years ago
|
||
Comment 5•9 years ago
|
||
Comment 6•9 years ago
|
||
Comment 7•9 years ago
|
||
Updated•7 years ago
|
Comment 9•6 years ago
|
||
Comment 11•6 years ago
|
||
Anne, do you know if <label> + focus is something valid in spec or is there any spec bug around this? Please see comment #5 and comment #6, Thanks.
Comment 12•6 years ago
|
||
I can't find a related specification bug and per the specification label only "transfers" focus when activated (i.e., its activation behavior; click) so I think Mats is correct about the bug mentioned in comment 5.
It does seem to me that the label should be part of the tabbing order and as far as I can tell it is in both Chrome and Firefox (on macOS), so comment 0 does not seem like a bug to me.
Comment 13•5 years ago
|
||
Any chance for this to be fixed now that https://bugzilla.mozilla.org/show_bug.cgi?id=1240285#c5 is confirmed a bug?
We have been receiving more reports about this, and there is no real workaround other than to not use <label>, which is unideal as it means we will have to refactor uses of label related APIs like the input.label association, and mimic the activation behavior with other elements.
Please let me know if there's anything we can do to help. Thanks.
Updated•5 years ago
|
Comment 14•5 years ago
•
|
||
It looks like Gecko always redirect the focus because it implements HTMLLabelElement::Focus()
and overloads the base class.
It's doesn't seems that the native click handling would call this method to "redirect" the focus? Should this method simply be removed since programmatically focus shouldn't be redirected?
Comment 15•5 years ago
•
|
||
Talked to :edgar offline and he can mentor this bug. I've given muan some pointers for information on setting up the dev environment.
Comment 16•5 years ago
|
||
(In reply to Tim Guan-tin Chien [:timdream] (please needinfo) from comment #14)
It's doesn't seem that the native click handling would call this method to "redirect" the focus?
No, the native click handling would not call HTMLLabelElement::Focus()
to redirect focus, it is handled in https://searchfox.org/mozilla-central/rev/6566d92dd46417a2f57e75c515135ebe84c9cef5/dom/html/HTMLLabelElement.cpp#145-149.
Should this method simply be removed since programmatically focus shouldn't be redirected?
Yes, it seems the overloaded method could be removed.
Assignee | ||
Comment 17•5 years ago
|
||
Focus should remain on the label rather than forwarded to the labeled
element.
Co-Authored-By: Mu-An Chiou <me@muanchiou.com>
Updated•5 years ago
|
Comment 18•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 19•5 years ago
|
||
Comment 22•5 years ago
|
||
bugherder |
Description
•