Skip to content

Commit 693f278

Browse files
author
Pascal Berger
committed
Don't restore focus if active element is body since this causes IE to switch windows.
Fixes McNull#61
1 parent 5577ad7 commit 693f278

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/angular-block-ui/service.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ blkUI.factory('blockUI', function(blockUIConfig, $timeout, blockUIUtils, $docume
4646

4747
$timeout(function() {
4848
// Ensure we still need to blur
49-
if(self._restoreFocus) {
49+
// Don't restore if active element is body, since this causes IE to switch windows (see http://tjvantoll.com/2013/08/30/bugs-with-document-activeelement-in-internet-explorer/)
50+
if (self._restoreFocus && self._restoreFocus !== $body[0]) {
5051
self._restoreFocus.blur();
5152
}
5253
});

0 commit comments

Comments
 (0)