Closed
Bug 1486487
Opened 6 years ago
Closed 6 years ago
<label control> for a <checkbox> only focuses the control instead of checking it
Categories
(Toolkit :: UI Widgets, enhancement, P3)
Toolkit
UI Widgets
Tracking
()
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
Details
Attachments
(1 file, 1 obsolete file)
See this code: https://searchfox.org/mozilla-central/rev/e126996d9b0a3d7653de205898517f4f5b632e7f/toolkit/content/widgets/text.xml#285 This makes the following code snippet not behave as expected: <label for="checkbox"/> <checkbox id="checkbox"/> since clicking on the label only focuses the checkbox, and we don't even draw the focus rect by default, so it seems like nothing happens when clicking on the label. It is much better to try to detect the type of the control here and check the checkbox if the type of the control is indeed a checkbox.
Assignee | ||
Comment 2•6 years ago
|
||
Attachment #9005517 -
Flags: review?(mconley)
Comment 3•6 years ago
|
||
Comment on attachment 9005517 [details] [diff] [review] Toggle a label's control in case it's a checkbox > <handler event="click" action="if (this.disabled) return; > var controlElement = this.labeledControlElement; >- if(controlElement) >+ if(controlElement) { > controlElement.focus(); >+ if (controlElement.localName === 'checkbox' && >+ controlElement.namespaceURI === 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul') { >+ controlElement.checked = !controlElement.checked; >+ } >+ } > "/> Please stop using the action attribute for this as it's getting overly long: <handler event="click"><![CDATA[ // code goes here ]]></handler>
Assignee | ||
Updated•6 years ago
|
Attachment #9005517 -
Attachment is obsolete: true
Attachment #9005517 -
Flags: review?(mconley)
Assignee | ||
Comment 4•6 years ago
|
||
Assignee: nobody → ehsan
Updated•6 years ago
|
Summary: <labal control> for a <checkbox> only focuses the control instead of checking it → <label control> for a <checkbox> only focuses the control instead of checking it
Updated•6 years ago
|
Attachment #9005930 -
Attachment is obsolete: true
Updated•6 years ago
|
Attachment #9005930 -
Attachment is obsolete: false
Comment 5•6 years ago
|
||
Comment on attachment 9005930 [details] Bug 1486487 - Toggle a label's control in case it's a checkbox; r=dao Dão Gottwald [::dao] has approved the revision.
Attachment #9005930 -
Flags: review+
Pushed by eakhgari@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/dbb51f1914eb Toggle a label's control in case it's a checkbox; r=dao
Updated•6 years ago
|
Priority: -- → P3
Comment 7•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dbb51f1914eb
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Updated•6 years ago
|
Target Milestone: mozilla64 → mozilla63
Updated•6 years ago
|
Target Milestone: mozilla63 → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•