-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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(autocomplete): allow number zero as value #5364
fix(autocomplete): allow number zero as value #5364
Conversation
* Currently the autocomplete does not properly display the selected options with the number zero as value. Fixes angular#5363.
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, one typo
@@ -358,7 +358,9 @@ export class MdAutocompleteTrigger implements ControlValueAccessor, OnDestroy { | |||
|
|||
private _setTriggerValue(value: any): void { | |||
const toDisplay = this.autocomplete.displayWith ? this.autocomplete.displayWith(value) : value; | |||
this._element.nativeElement.value = toDisplay || ''; | |||
// Simply falling back to an empty string if the display value is falsy does not work properly. | |||
// The display value can also be the number zero and shouldn't fallback to an empty string. |
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.
Typo: fallback
-> fall back
.
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, one typo
c5ec6eb
to
a98a8c1
Compare
* fix(autocomplete): allow number zero as value * Currently the autocomplete does not properly display the selected options with the number zero as value. Fixes angular#5363. * Fix typo
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 #5363.