From 460d3d1999907027343fbd5b2c191da889cee8e2 Mon Sep 17 00:00:00 2001 From: Rein Baarsma Date: Tue, 5 Jul 2016 09:03:20 +0200 Subject: [PATCH] fix(typeahead): removed incorrect behavior to do ENTER behavior on TAB. TAB should simply skip to next field as expected. fixes #686, fixes #490, closes #689 --- components/typeahead/typeahead.directive.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/components/typeahead/typeahead.directive.ts b/components/typeahead/typeahead.directive.ts index cc2ec58630..13e4ec8ade 100644 --- a/components/typeahead/typeahead.directive.ts +++ b/components/typeahead/typeahead.directive.ts @@ -135,17 +135,11 @@ export class TypeaheadDirective implements OnInit { return; } - // if shift + tab, close items list - if (e.shiftKey && e.keyCode === 9) { + // if tab default browser behavior will select next input field, and therefore we should close the items list + if (e.keyCode === 9) { this.hide(); return; } - - // if tab select current item - if (!e.shiftKey && e.keyCode === 9) { - this.container.selectActiveMatch(); - return; - } } public constructor(cd:NgModel, viewContainerRef:ViewContainerRef, element:ElementRef,