-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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(chips): do not set chips value if there's no ngControl or value #7285
Conversation
src/lib/chips/chip-list.ts
Outdated
@@ -572,8 +572,10 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor | |||
// Defer setting the value in order to avoid the "Expression | |||
// has changed after it was checked" errors from Angular. | |||
Promise.resolve().then(() => { | |||
this._setSelectionByValue(this.ngControl ? this.ngControl.value : this._value, false); | |||
this.stateChanges.next(); | |||
if (!!this.ngControl || !!this._value) { |
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.
You don't need the !!
in conditional expressions, only when the value will be passed around somewhere
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.
Done. PTAL. Thanks for review.
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.
Need to push your changes?
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.
Changes are pushed. Thanks!
1c6e48a
to
638adf4
Compare
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
638adf4
to
10597dd
Compare
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. |
Fixes #7261