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

Commit 709e679

Browse files
fix(modal): focus freshly opened modal
Closes #1187
1 parent ea053b1 commit 709e679

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/modal/modal.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ angular.module('ui.bootstrap.modal', [])
9393
link: function (scope, element, attrs) {
9494
scope.windowClass = attrs.windowClass || '';
9595

96-
//trigger CSS transitions
96+
// focus a freshly-opened modal
97+
element[0].focus();
98+
9799
$timeout(function () {
100+
// trigger CSS transitions
98101
scope.animate = true;
99102
});
100103
}

template/modal/window.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class="modal fade {{ windowClass }}" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10}" ng-transclude></div>
1+
<div tabindex="-1" class="modal fade {{ windowClass }}" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10}" ng-transclude></div>

0 commit comments

Comments
 (0)