From 26bd5d0e5feecac50dca9448f9ecc79001fd3497 Mon Sep 17 00:00:00 2001 From: Jeffrey Hamans Date: Fri, 18 Dec 2015 12:19:35 +0100 Subject: [PATCH 1/2] fix(modal): stop IE throwing exception on focus check if the element the model is appended to supports focus before actually calling focus. --- src/modal/modal.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modal/modal.js b/src/modal/modal.js index 7b740fa1ca..285e2a4ea5 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -309,7 +309,9 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap']) if (elementToReceiveFocus && elementToReceiveFocus.focus) { elementToReceiveFocus.focus(); } else { - appendToElement.focus(); + if(appendToElement.focus) { + appendToElement.focus(); + } } } From b63221e406fac42b8d031637ba2f29109f6f1a23 Mon Sep 17 00:00:00 2001 From: Jeffrey Hamans Date: Fri, 18 Dec 2015 16:02:30 +0100 Subject: [PATCH 2/2] Update modal.js --- src/modal/modal.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modal/modal.js b/src/modal/modal.js index 285e2a4ea5..cff8ef06ad 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -308,10 +308,8 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap']) //move focus to specified element if available, or else to body if (elementToReceiveFocus && elementToReceiveFocus.focus) { elementToReceiveFocus.focus(); - } else { - if(appendToElement.focus) { - appendToElement.focus(); - } + } else if(appendToElement.focus) { + appendToElement.focus(); } }