Skip to content

md-checkbox: Implement a three state checkbox #2883

@web265p3

Description

@web265p3

I would like to configure the md-checkbox like the following:

If its disabled and I click it, it should be enabled.
If its enabled and I click it, it should be indeterminate
If its indeterminate and I click it, it should be disabled

I tried to write a click-function, that does exactly that:

<md-checkbox #check (click)="toggle(check)">Checked</md-checkbox>

In the toggle-function I access check.indeterminate, checked etc. and set the values. But of course these values are overwritten by the default behaviour of the check box.
How would you implement that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions