Skip to content

Commit

Permalink
fix(typeahead): fix flickering (#3321)
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaSurmay authored and valorkin committed Jan 9, 2018
1 parent 6804eaf commit cf1411a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ export class TypeaheadDirective implements OnInit, OnDestroy {
dropup: this.dropup
});

this._outsideClickListener = this.renderer.listen('document', 'click', () => {
this._outsideClickListener = this.renderer.listen('document', 'click', (e: MouseEvent) => {
if (this.typeaheadMinLength === 0 && this.element.nativeElement.contains(e.target)) {
return;
}
this.onOutsideClick();
});

Expand Down

0 comments on commit cf1411a

Please sign in to comment.