Closed Bug 1894489 Opened 5 months ago Closed 4 months ago

Add disabled support to moz-checkbox

Categories

(Toolkit :: UI Widgets, task)

task

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: mstriemer, Assigned: tgiles)

References

(Blocks 1 open bug)

Details

(Whiteboard: [recomp])

Attachments

(1 file)

Checkboxes can be disabled, therefore we should support the disabled attribute/property in moz-checkbox

Assignee: nobody → tgiles
Status: NEW → ASSIGNED

This change adds the "disabled" state to moz-checkbox. This involves
setting disabled on the host element, the label element, and the
checkbox. Since label elements do not support the disabled attribute,
I needed to set the property and the attribute (?disabled, .disabled).
By setting the HTML attribute, we can style the label when moz-checkbox
is disabled.

I could simplify the label to use only the HTML attribute (?disabled),
but then I'd need to rewrite the tests. I don't have a strong opinion on
this, so if we prefer just the HTML attribute, I'm happy to make that
change.

This patch also sets the disabled text color to GrayText, as we don't
have a token for the combination currently in Figma (#5b5b66, #cfcfd8)
but happy to add that combination if we want that. I was unable to find
an existing token for #cfcfd8, which is why I went with the system
color GrayText.

Pushed by tgiles@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a1e4a50f2b35
Add disabled state to moz-checkbox. r=reusable-components-reviewers,mstriemer
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: