Skip to content

Commit

Permalink
fix(typeahead): removed incorrect behavior to do ENTER behavior on TA…
Browse files Browse the repository at this point in the history
…B. TAB should simply skip to next field as expected.

fixes #686, fixes  #490, closes #689
  • Loading branch information
rbaarsma authored and valorkin committed Jul 11, 2016
1 parent a36d5f3 commit 460d3d1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions components/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 460d3d1

Please sign in to comment.