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

Commit

Permalink
fix(modal): focus freshly opened modal
Browse files Browse the repository at this point in the history
Closes #1187
  • Loading branch information
pkozlowski-opensource committed Dec 20, 2013
1 parent ea053b1 commit 709e679
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ angular.module('ui.bootstrap.modal', [])
link: function (scope, element, attrs) {
scope.windowClass = attrs.windowClass || '';

//trigger CSS transitions
// focus a freshly-opened modal
element[0].focus();

$timeout(function () {
// trigger CSS transitions
scope.animate = true;
});
}
Expand Down
2 changes: 1 addition & 1 deletion template/modal/window.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="modal fade {{ windowClass }}" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10}" ng-transclude></div>
<div tabindex="-1" class="modal fade {{ windowClass }}" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10}" ng-transclude></div>

0 comments on commit 709e679

Please sign in to comment.