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

fix(material/chips): Async chips with a delay are not highlighted #27399

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yurakhomitsky
Copy link

Fixes a bug in the Angular Material chips component where async chips with a delay were not highlighted correctly.

Fixes #27370

@google-cla
Copy link

google-cla bot commented Jul 2, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@yurakhomitsky yurakhomitsky marked this pull request as draft July 2, 2023 11:29
@yurakhomitsky yurakhomitsky marked this pull request as ready for review July 2, 2023 13:44
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mmalerba mmalerba added action: merge The PR is ready for merge by the caretaker area: material/chips labels Jul 11, 2023
this._chips.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => {
if (this.value !== undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be if (this.value === undefined) {. Previously we were checking _pendingInitialValue !== undefined, which implied the value was undefined, as the pending value had not been set. Hopefully making this change will resolve the test failures I'm seeing in google

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change if (this.value === undefined) fails even more unit tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, in that case I think there's something subtly different between checking if the value is undefined vs the _pendingInitialValue flag. What if we try adding back the flag, but keep the rest of the changes?

Copy link
Author

@yurakhomitsky yurakhomitsky Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmalerba How will I know whether my adjustments solved the issue? Where am I able to view it? You mentioned that some Google tests were failing; what is in there now?

Copy link
Contributor

@mmalerba mmalerba Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have to rerun the internal tests and report back

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmalerba Any updates? I have synced the branch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking better - there's still 3 failing tests, 1 ExpressionChangedAfterChecked and 2 screenshot diffs that look possibly wrong. It's not clear if these are issues with the changes or issues with the tests themselves. Unfortunately I don't think there's much we can do until I have some time to dig deeper into it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for letting me know! In case you need me to update the branch just ping

@yurakhomitsky yurakhomitsky force-pushed the fix-selecting-async-chip branch 2 times, most recently from bd5b54c to 3ecfb2b Compare September 27, 2023 10:36
@mmalerba mmalerba self-assigned this Sep 28, 2023
Fixes a bug in the Angular Material `chips` component where async chips with a delay were not highlighted correctly.

Fixes angular#27370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: material/chips
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(CHIPS): Async Chips are not highlighted with Forms
2 participants