If you shift+click or ctrl+click on a label for a checkbox, checkbox is not checked.
Categories
(Core :: DOM: Forms, defect)
Tracking
()
People
(Reporter: gordeon, Assigned: edgar)
References
Details
Attachments
(4 files)
Comment 1•15 years ago
|
||
Comment 2•14 years ago
|
||
Comment 3•14 years ago
|
||
Comment 4•13 years ago
|
||
Comment 5•13 years ago
|
||
Comment 6•12 years ago
|
||
![]() |
||
Updated•12 years ago
|
![]() |
||
Updated•12 years ago
|
![]() |
||
Updated•12 years ago
|
Comment 8•12 years ago
|
||
Comment 9•11 years ago
|
||
Comment 10•11 years ago
|
||
Comment 11•11 years ago
|
||
Comment 12•11 years ago
|
||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
Comment 15•7 years ago
|
||
Comment 16•6 years ago
|
||
Bug still exists in FF 70.0.1
Comment 17•6 years ago
|
||
Bug still occurs in FF 71.0
Comment 18•5 years ago
|
||
Bug still happen on FF 72.
This is really annoying when you use custom checkboxes by targetting the neighbor in CSS. For example, ProtonMail beta v4 is impacted, see https://design-system-beta.netlify.com/forms/
Comment 19•5 years ago
|
||
Could be related to #764822 ?
Ctrl or Shift + Enter on an input field will not report the modifiers.
Comment 20•5 years ago
|
||
bug 764822 for the link
http://jsfiddle.net/ReD6k for the fiddle, try to Shift+Click or Shift+Enter (with focus on input) to see the difference in the modifiers
Comment 21•5 years ago
|
||
This is still a problem in FF 84.
Same usecase as everyone above - custom checkboxes.
Comment 22•3 years ago
|
||
Also an issue with the Alt key. Here's a fiddle - https://jsfiddle.net/rothschild86/y8hrxf06/10/
To test in FF - Press ALT, and click on the label Option (any). Click again to observe the effect - everything should work.
Now, remove the code past line 11. Repeat the test, see that the Alt-click no longer has any effect.
Notice, that the code still words fine with just the first 11 lines in Chrome.
Updated•3 years ago
|
Comment 23•1 year ago
|
||
This very old issue still exists with Firefox 125.0.1 on latest macOS.
Comment 24•1 year ago
|
||
Done
• Added HasSelection checking if there is an active text selection within the label.
• Adjusted the PostHandleEvent to account for shift+click behavior when there is no active selection.
Testing:
• Verify that clicking on a checkbox label toggles the checkbox.
• Click outside of the checkbox to start a selection. Verify that shift+click on a checkbox label allows to select text within the label and checkbox state remains unchanged.
Comment 25•1 year ago
|
||
HTML test case to use with test steps described in the previous comment.
Comment 26•1 year ago
|
||
Thanks for the patch! Given that the changed files are in /dom
rather than /layout
, I'm going to reclassify this under the DOM forms component.
To get the patch-review process started -- we use phabricator for patch submission and code review (with a simple local utility called moz-phab
to submit revisions from your local mercurial or git repo). Some instructions to submit a patch for review are here:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html#to-submit-a-patch
Could you take a look there and submit the patch using moz-phab
?
(I'll go ahead and assign the bug to you, too, since I think phabricator might require that, for newish bugzilla accounts.)
Comment 27•1 year ago
|
||
Also: I'm not a reviewer for changes in /dom
, but I'll leave a few drive-by review nits from glancing at the patch:
- Commit message should describe the change, e.g. "bug 559506: check for selection when handling shift+click on labels" or something along those lines
- The added
#include
statements should be inserted in alphabetically sorted order into the include list (as much as possible, the existing list isn't always well sorted) - The added function-declaration
bool HasSelection()
should be inserted up alongside other function declarations, rather than after the member-variables. - You don't need to null-check the result of
nsPresContext* presContext = frame->PresContext();
-- presContext will always be null there. (We have a convention that getters-that-are-guaranteed-to-return-something-non-null skip the use of "Get", as in this case.)
Comment 28•1 year ago
|
||
- add HasSelection method to HTMLLabelElement
- update PostHandleEvent to consider active selection when handling shift+click events
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 29•8 months ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Comment 30•8 months ago
|
||
Edgar, is this something we should land? It looks like it stalled out after the patch got reviewed. It has been awhile so it might need to be rebased. Thanks.
Assignee | ||
Comment 31•7 months ago
|
||
I will take a look.
Comment 32•2 months ago
|
||
Any movement on this?
Description
•