Skip to content

bug(mat-checkbox): Animation issue with Indeterminate state #25289

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

Closed
rafdewit opened this issue Jul 15, 2022 · 1 comment · Fixed by #25297
Closed

bug(mat-checkbox): Animation issue with Indeterminate state #25289

rafdewit opened this issue Jul 15, 2022 · 1 comment · Fixed by #25297
Assignees
Labels
area: material/checkbox P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@rafdewit
Copy link

rafdewit commented Jul 15, 2022

Description

When a checkbox is loaded with checked=true & indeterminate=false, the first time it changes to indeterminate=true the animation does not work properly. The checkbox visually goes to "empty/false" and then to the indeterminate state. Any further checked and indeterminate change after works properly with animations.

I've reproduced this on a checkbox-overview-example fork:
https://stackblitz.com/edit/angular-qtmlqq-t7otn9?file=src/app/checkbox-overview-example.ts

Reproduction

Steps to reproduce:

  1. https://stackblitz.com/edit/angular-qtmlqq-t7otn9?file=src/app/checkbox-overview-example.ts
  2. uncheck a subtask
  3. observe the parent task state change animation from checked=true to indeterminate=true

Expected Behavior

Animation between checked and indeterminate state on indeterminate state change true => false. (checked = true)

Actual Behavior

Animation bug: change indeterminate state does not animate properly the first time.

Environment

  • Angular: 14.0.0
  • CDK/Material: 14.0.5
  • Browser(s): Chrome
  • Operating System: Windows
@rafdewit rafdewit added the needs triage This issue needs to be triaged by the team label Jul 15, 2022
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent has pr area: material/checkbox and removed needs triage This issue needs to be triaged by the team labels Jul 17, 2022
@crisbeto crisbeto self-assigned this Jul 17, 2022
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 17, 2022
…-checked to indeterminate

Fixes that we weren't setting the correct animation class when the checkbox goes from being pre-checked to indeterminate.

Fixes angular#25289.
crisbeto added a commit that referenced this issue Jul 20, 2022
…-checked to indeterminate (#25297)

Fixes that we weren't setting the correct animation class when the checkbox goes from being pre-checked to indeterminate.

Fixes #25289.
crisbeto added a commit that referenced this issue Jul 20, 2022
…-checked to indeterminate (#25297)

Fixes that we weren't setting the correct animation class when the checkbox goes from being pre-checked to indeterminate.

Fixes #25289.

(cherry picked from commit cf6b83e)
crisbeto added a commit that referenced this issue Jul 20, 2022
…-checked to indeterminate (#25297)

Fixes that we weren't setting the correct animation class when the checkbox goes from being pre-checked to indeterminate.

Fixes #25289.

(cherry picked from commit cf6b83e)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/checkbox P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
2 participants