Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indeterminate checkbox doesn't change when changed from code #658

Closed
stefanloerwald opened this issue Jul 29, 2020 · 1 comment · Fixed by #664
Closed

Indeterminate checkbox doesn't change when changed from code #658

stefanloerwald opened this issue Jul 29, 2020 · 1 comment · Fixed by #664
Assignees
Labels
bug Something isn't working

Comments

@stefanloerwald
Copy link
Contributor

Describe the bug

When Indeterminate="true" is set on a MatCheckbox, setting the value from code does not alter the visible state of the checkbox (it works fine when Indeterminate is false).

To Reproduce

<MatBlazor.MatCheckbox Indeterminate="true" Value="Value">Current value: @(Value == null ? "null" : Value.Value.ToString())</MatBlazor.MatCheckbox>
<MatBlazor.MatButton Label="Set to true" OnClick="() => Value = true" />
<MatBlazor.MatButton Label="Set to null" OnClick="() => Value = null" />
<MatBlazor.MatButton Label="Set to false" OnClick="() => Value = false" />

@code {
    public bool? Value { get; set; }
}

Click the buttons. The state of the checkbox doesn't change.

Blazorfiddle link
https://blazorfiddle.com/s/s7wd0j1x

Expected behavior
The checkbox state should change between clear, checked and indeterminate depending on the value of the nullable boolean.

Version is 2.6.2

@stefanloerwald stefanloerwald added the bug Something isn't working label Jul 29, 2020
@lindespang lindespang self-assigned this Jul 29, 2020
@lindespang
Copy link
Collaborator

@stefanloerwald I have developed a fix for this and will submit PR tomorrow, thanks for the report!

@lindespang lindespang linked a pull request Jul 30, 2020 that will close this issue
@SamProf SamProf closed this as completed in a8c89e6 Sep 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants