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

Commit 22a00cd

Browse files
fix(typeahead): stop keydown event propagation when ESC pressed to discard matches
Closes #243
1 parent 2c9dc05 commit 22a00cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/typeahead/typeahead.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ angular.module('ui.bootstrap.typeahead', [])
126126
modelCtrl.$render();
127127
};
128128

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

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

152152
} else if (evt.which === 27) {
153+
evt.stopPropagation();
153154
scope.matches = [];
154155
scope.$digest();
155156
}

0 commit comments

Comments
 (0)