From 709e679c5beceeb71f98553005666fbad860866c Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Fri, 20 Dec 2013 17:30:40 +0100 Subject: [PATCH] fix(modal): focus freshly opened modal Closes #1187 --- src/modal/modal.js | 5 ++++- template/modal/window.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modal/modal.js b/src/modal/modal.js index b3036a3d43..a1955a3c0b 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -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; }); } diff --git a/template/modal/window.html b/template/modal/window.html index 3714dd61e6..3e83b0bddc 100644 --- a/template/modal/window.html +++ b/template/modal/window.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file