Skip to content

Commit

Permalink
removed incorrect behavior to do ENTER behavior on TAB. TAB should si…
Browse files Browse the repository at this point in the history
…mply skip to next field as expected. Solves valor-software#686 and valor-software#490
  • Loading branch information
rbaarsma committed Jul 5, 2016
1 parent 84c07f8 commit ab658d6
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 @@ -143,17 +143,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 ab658d6

Please sign in to comment.