Skip to content

Commit

Permalink
fix(typeahead): need to check if _matches is not undefined in the `…
Browse files Browse the repository at this point in the history
…blur` handler (#6028)

fix(typeahead): need to check if `_matches` is not undefined in the `blur` handler (#6028)

Co-authored-by: lukasz-madej <lukasz.madej@kreuzwerker.pl>
Co-authored-by: Dmitriy Shekhovtsov <valorkin@gmail.com>
Co-authored-by: Dmitriy Danilov <daniloff200@gmail.com>
  • Loading branch information
4 people authored Jul 29, 2021
1 parent b6bb985 commit c0beddb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ export class TypeaheadDirective implements OnInit, OnDestroy {
this.typeaheadOnBlur.emit(this._container.active);
}

if (!this.container && this._matches.length === 0) {
if (!this.container && this._matches?.length === 0) {
this.typeaheadOnBlur.emit(new TypeaheadMatch(
this.element.nativeElement.value,
this.element.nativeElement.value,
this.element.nativeElement.value,
false));
}
}
Expand Down

0 comments on commit c0beddb

Please sign in to comment.