Skip to content

Conversation

devversion
Copy link
Member

  • Currently the autocomplete does not properly display the selected options with the number zero as value.

Fixes #5363.

* Currently the autocomplete does not properly display the selected options with the number zero as value.

Fixes angular#5363.
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 26, 2017
Copy link
Contributor

@kara kara left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: fallback -> fall back.

Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

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

LGTM, one typo

@kara kara removed their assignment Jun 26, 2017
@devversion devversion force-pushed the fix/autocomplete-number-zero branch from c5ec6eb to a98a8c1 Compare June 26, 2017 17:42
@devversion devversion added the action: merge The PR is ready for merge by the caretaker label Jun 26, 2017
@tinayuangao tinayuangao merged commit 9137fd9 into angular:master Jun 28, 2017
amcdnl pushed a commit to amcdnl/material2 that referenced this pull request Jul 8, 2017
* 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
@devversion devversion deleted the fix/autocomplete-number-zero branch November 11, 2017 10:23
@angular-automatic-lock-bot
Copy link

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 Sep 7, 2019
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AutoComplete value of number 0
4 participants