Skip to content

Commit

Permalink
fix(typeahead): dont throw error if latinize is off and no value for …
Browse files Browse the repository at this point in the history
…input (#4480)

fixes #4465
  • Loading branch information
valorkin authored Jul 5, 2018
1 parent 86dd8e8 commit fa6f174
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,12 @@ export class TypeaheadDirective implements OnInit, OnDestroy {
}

if (this._container) {
// This improves the speed as it won't have to be done for each list item
const normalizedQuery = (this.typeaheadLatinize
// fix: remove usage of ngControl internals
const _controlValue = (this.typeaheadLatinize
? latinize(this.ngControl.control.value)
: this.ngControl.control.value)
.toString()
.toLowerCase();
: this.ngControl.control.value) || '';
// This improves the speed as it won't have to be done for each list item
const normalizedQuery = _controlValue.toString().toLowerCase();
this._container.query = this.typeaheadSingleWords
? tokenize(
normalizedQuery,
Expand Down

0 comments on commit fa6f174

Please sign in to comment.