Skip to content

Commit

Permalink
related to angular-ui#2916 ; use tab
Browse files Browse the repository at this point in the history
just for navigation, do not select from list
  • Loading branch information
lvostinar committed Oct 22, 2015
1 parent 49e73a8 commit e5984ee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
return;
}

evt.preventDefault();
if (evt.which !== 9) evt.preventDefault();

if (evt.which === 40) {
scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length;
Expand All @@ -300,11 +300,15 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1;
scope.$digest();

} else if (evt.which === 13 || evt.which === 9) {
} else if (evt.which === 13) {
scope.$apply(function () {
scope.select(scope.activeIdx);
});

} else if (evt.which === 9) {
resetMatches();
scope.$digest();

} else if (evt.which === 27) {
evt.stopPropagation();

Expand Down

0 comments on commit e5984ee

Please sign in to comment.