google / google/material-design-lite

State of switches should automatically reflect state of the underlying input's "checked" property

Open
#1,540 10 comments 6 reactions 0 assignees View on GitHub
Checkbox research Switch
Dominant language
HTML
Stars
32.2k
Forks
4.9k
PR merge metrics
No merged PRs in 30d

Description

At present modification of the `.checked` property of the underlying input of switches (and perhaps other similar components, e.g. radio and checkboxes, I haven't checked, pun intended) doesn't automatically result in an update to the presentation layer - instead a manual call to `.MaterialCheckbox.check()` or `.MaterialCheckbox.uncheck()` is needed.

I propose that this shouldn't be the case, MDL should progressively enhance the underlying input by listening for changes to the value of `.checked` and automatically fire the appropriate function to update the visual state, which would allow existing code / code from other libraries to be used without modification and would avoid confusing new users of MDL.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.