Skip to content

Commit

Permalink
fix(typehead): skip writing backup value if value is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
wannadream committed Nov 5, 2018
1 parent aca4cbe commit 50cedb1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/typeahead/typeahead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ export class NgbTypeahead implements ControlValueAccessor,
dismissPopup() {
if (this.isPopupOpen()) {
this._closePopup();
this._writeInputValue(this._inputValueBackup);
if (this._elementRef.nativeElement.value !== '') {
this._writeInputValue(this._inputValueBackup);
}
}
}

Expand Down

0 comments on commit 50cedb1

Please sign in to comment.