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

bug(mat-chip-grid): mat-form-field disabled state doesn't get updated when setting [disabled]=false on the mat-chip-grid element #30017

Closed
1 task
Raphyyy opened this issue Nov 14, 2024 · 1 comment · Fixed by #30033
Assignees
Labels
area: material/chips P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@Raphyyy
Copy link

Raphyyy commented Nov 14, 2024

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

The mat-form-field element wrapping mat-chip-grid appears to not catch the disabled state change from the mat-chip-grid element.
If you init the mat-chip-grid element with [disabled]=true then later you turn it off to false, the element still appears disabled. You need to click on it for it so it doesn't appears disabled anymore.

Reproduction

StackBlitz link: https://stackblitz.com/edit/gmyir1
Steps to reproduce:

  1. Wait one second
  2. Despite the setTimeout(() => { this.disabled = false; }, 1000); the element still appears disabled
  3. Click on it so it doesn't appears disabled anymore

Expected Behavior

The mat-form-field shouldn't appears disabled if the mat-chip-grid isn't.

Actual Behavior

The mat-form-field appears disabled no matter what if mat-chip-grid.disabled is set to true on init.

Environment

  • Angular: 18.2.12
  • CDK/Material: 18.2.12
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@Raphyyy Raphyyy added the needs triage This issue needs to be triaged by the team label Nov 14, 2024
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/chips and removed needs triage This issue needs to be triaged by the team labels Nov 15, 2024
@crisbeto crisbeto self-assigned this Nov 18, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 18, 2024
Fixes that the chip grid wasn't emitting to its `stateChanges` when it becomes disabled which meant that the parent form field might not update correctly.

Fixes angular#30017.
crisbeto added a commit that referenced this issue Nov 20, 2024
…30033)

Fixes that the chip grid wasn't emitting to its `stateChanges` when it becomes disabled which meant that the parent form field might not update correctly.

Fixes #30017.

(cherry picked from commit 8980ad5)
@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 Dec 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/chips P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants