Skip to content

Commit da95122

Browse files
bekospkozlowski-opensource
authored andcommitted
fix(modal): prevent default event when closing via escape key
Fixes angular-ui#1692 Closes angular-ui#2087
1 parent 96def3d commit da95122

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/modal/modal.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition'])
201201
if (evt.which === 27) {
202202
modal = openedWindows.top();
203203
if (modal && modal.value.keyboard) {
204+
evt.preventDefault();
204205
$rootScope.$apply(function () {
205206
$modalStack.dismiss(modal.key, 'escape key press');
206207
});

0 commit comments

Comments
 (0)