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

Commit

Permalink
fix(modal): prevent default event when closing via escape key
Browse files Browse the repository at this point in the history
Fixes #1692
Closes #2087
  • Loading branch information
bekos authored and pkozlowski-opensource committed Apr 19, 2014
1 parent 96def3d commit da95122
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition'])
if (evt.which === 27) {
modal = openedWindows.top();
if (modal && modal.value.keyboard) {
evt.preventDefault();
$rootScope.$apply(function () {
$modalStack.dismiss(modal.key, 'escape key press');
});
Expand Down

0 comments on commit da95122

Please sign in to comment.