From eaed1182b9d0b032d6ffb50d39728526831d9aa5 Mon Sep 17 00:00:00 2001 From: Ilya Surmay Date: Fri, 5 Jan 2018 16:26:05 +0200 Subject: [PATCH] fix(typeahead): fix autoselect on tab key with typeaheadMinLength=0 (#3378) --- src/typeahead/typeahead.directive.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/typeahead/typeahead.directive.ts b/src/typeahead/typeahead.directive.ts index 362d5aefc8..8c3635a24b 100644 --- a/src/typeahead/typeahead.directive.ts +++ b/src/typeahead/typeahead.directive.ts @@ -220,7 +220,7 @@ export class TypeaheadDirective implements OnInit, OnDestroy { } // enter, tab - if (e.keyCode === 13 || e.keyCode === 9) { + if (e.keyCode === 13) { this._container.selectActiveMatch(); return; @@ -261,6 +261,7 @@ export class TypeaheadDirective implements OnInit, OnDestroy { // if an item is visible - don't change focus if (e.keyCode === 9) { e.preventDefault(); + this._container.selectActiveMatch(); return; }