-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(material-experimental/chips): fix empty check when no chips #20025
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
Conversation
| @@ -154,7 +154,7 @@ export class MatChipGrid extends _MatChipGridMixinBase implements AfterContentIn | |||
| * Implemented as part of MatFormFieldControl. | |||
| * @docs-private | |||
| */ | |||
| get empty(): boolean { return this._chipInput.empty && this._chips.length === 0; } | |||
| get empty(): boolean { return this._chipInput.empty && (!this._chips || this._chips.length === 0); } | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we null check for the _chipInput too? AFAIK it's not guaranteed to be defined either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should - just wasn't an issue internally. I added a change to include that too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* fix(material-experimental/chips): fix empty check when no chips * same for chipset * check for input too (cherry picked from commit ebda4de)
…lar#20025) * fix(material-experimental/chips): fix empty check when no chips * same for chipset * check for input too
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Similar check that was necessitated from PR #10466 - due to changes in the change detection cycle from input, its possible that
emptyis called earlier and should account for when there are nochipspicked up yet