Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(typeahead): stop keydown event propagation when ESC pressed to di…
Browse files Browse the repository at this point in the history
…scard matches

Closes #243
  • Loading branch information
pkozlowski-opensource committed Mar 19, 2013
1 parent 2c9dc05 commit 22a00cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ angular.module('ui.bootstrap.typeahead', [])
modelCtrl.$render();
};

//bind keyboard events: arrows up(38) / down(40), enter(13) and tab(9), esc(9)
//bind keyboard events: arrows up(38) / down(40), enter(13) and tab(9), esc(27)
element.bind('keydown', function (evt) {

//typeahead is open and an "interesting" key was pressed
Expand All @@ -150,6 +150,7 @@ angular.module('ui.bootstrap.typeahead', [])
});

} else if (evt.which === 27) {
evt.stopPropagation();
scope.matches = [];
scope.$digest();
}
Expand Down

0 comments on commit 22a00cd

Please sign in to comment.