Skip to content

fix(material/chips): wait for onStable when editing a chip #27464

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
wants to merge 1 commit into from

Conversation

zarend
Copy link
Contributor

@zarend zarend commented Jul 14, 2023

Address timing issue with MatChipRow. When a chip enters the editing state wait for ngZone's onStable event before accessing the ViewChild for the MatChipEditInput. Attempts to fix issue where editable chip goes blank when entering the editing state (#27462).

What seemed to be happening is that the view would render the MatChiEditInput when setting _isEditing to true, but sometimes the ViewChild would not be initialized in the component. Address this issue by adding additional wait using _ngZone.onStable.

Fix #27462.

Address timing issue with MatChipRow. When a chip enters the editing
state wait for ngZone's `onStable` event before accessing the ViewChild
for the MatChipEditInput. Attempts to fix issue where editable chip goes
blank when entering the editing state (angular#27462).

What seemed to be happening is that the view would render the
MatChiEditInput when setting `_isEditing` to true, but sometimes the
ViewChild would not be initialized in the component. Address this issue
by adding additional wait using `_ngZone.onStable`.

Fix angular#27462.
@zarend zarend added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/chips dev-app preview When applied, previews of the dev-app are deployed to Firebase action: review The PR is still awaiting reviews from at least one requested reviewer labels Jul 14, 2023
@zarend zarend requested review from mmalerba and crisbeto as code owners July 14, 2023 23:22
@github-actions
Copy link

Deployed dev-app for 2169f3f to: https://ng-dev-previews-comp--pr-angular-components-27464-rf0ldvar.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@zarend
Copy link
Contributor Author

zarend commented Jul 27, 2023

Closing in favor of #27465

@zarend zarend closed this Jul 27, 2023
@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 27, 2023
@zarend zarend deleted the chip-edit-input-timing branch August 28, 2023 17:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: review The PR is still awaiting reviews from at least one requested reviewer area: material/chips dev-app preview When applied, previews of the dev-app are deployed to Firebase P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(material/chips): Chip is cleared when entering the editing state.
1 participant