Skip to content

fix(material-experimental/chips): fix empty check when no chips - #20025

Merged
andrewseguin merged 3 commits into
angular:masterfrom
andrewseguin:chip-grid-empty
Jul 17, 2020
Merged

fix(material-experimental/chips): fix empty check when no chips#20025
andrewseguin merged 3 commits into
angular:masterfrom
andrewseguin:chip-grid-empty

Conversation

@andrewseguin

Copy link
Copy Markdown
Contributor

Similar check that was necessitated from PR #10466 - due to changes in the change detection cycle from input, its possible that empty is called earlier and should account for when there are no chips picked up yet

@andrewseguin
andrewseguin requested a review from mmalerba as a code owner July 17, 2020 13:51
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 17, 2020
@andrewseguin andrewseguin added P2 The issue is important to a large percentage of users, with a workaround and removed cla: yes PR author has agreed to Google's Contributor License Agreement labels Jul 17, 2020
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 17, 2020
@andrewseguin
andrewseguin requested a review from crisbeto July 17, 2020 13:51
@andrewseguin andrewseguin added the target: patch This PR is targeted for the next patch release label Jul 17, 2020
* @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); }

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

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

@crisbeto crisbeto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@crisbeto crisbeto added lgtm action: merge The PR is ready for merge by the caretaker labels Jul 17, 2020
@andrewseguin
andrewseguin merged commit ebda4de into angular:master Jul 17, 2020
andrewseguin added a commit that referenced this pull request Jul 17, 2020
* fix(material-experimental/chips): fix empty check when no chips

* same for chipset

* check for input too

(cherry picked from commit ebda4de)
ngwattcos pushed a commit to ngwattcos/components that referenced this pull request Jul 20, 2020
…lar#20025)

* fix(material-experimental/chips): fix empty check when no chips

* same for chipset

* check for input too
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants