react-focus-lock
Advanced tools
Comparing version 2.13.4 to 2.13.5
@@ -100,5 +100,4 @@ "use strict"; | ||
var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement; | ||
if (focusOnBody() && lastActiveFocus) { | ||
if (focusOnBody() && lastActiveFocus && lastActiveFocus !== document.body) { | ||
if (!document.body.contains(lastActiveFocus) || isNotFocusable(lastActiveFocus)) { | ||
lastActiveFocus = null; | ||
var newTarget = tryRestoreFocus(); | ||
@@ -139,5 +138,7 @@ if (newTarget) { | ||
} | ||
lastActiveFocus = document && document.activeElement; | ||
if (lastActiveFocus !== document.body) { | ||
tryRestoreFocus = (0, _focusLock.captureFocusRestore)(lastActiveFocus); | ||
} | ||
focusWasOutsideWindow = false; | ||
lastActiveFocus = document && document.activeElement; | ||
tryRestoreFocus = (0, _focusLock.captureFocusRestore)(lastActiveFocus); | ||
} | ||
@@ -144,0 +145,0 @@ } |
@@ -92,5 +92,4 @@ import React from 'react'; | ||
var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement; | ||
if (focusOnBody() && lastActiveFocus) { | ||
if (focusOnBody() && lastActiveFocus && lastActiveFocus !== document.body) { | ||
if (!document.body.contains(lastActiveFocus) || isNotFocusable(lastActiveFocus)) { | ||
lastActiveFocus = null; | ||
var newTarget = tryRestoreFocus(); | ||
@@ -131,5 +130,7 @@ if (newTarget) { | ||
} | ||
lastActiveFocus = document && document.activeElement; | ||
if (lastActiveFocus !== document.body) { | ||
tryRestoreFocus = captureFocusRestore(lastActiveFocus); | ||
} | ||
focusWasOutsideWindow = false; | ||
lastActiveFocus = document && document.activeElement; | ||
tryRestoreFocus = captureFocusRestore(lastActiveFocus); | ||
} | ||
@@ -136,0 +137,0 @@ } |
{ | ||
"name": "react-focus-lock", | ||
"version": "2.13.4", | ||
"version": "2.13.5", | ||
"description": "It is a trap! (for a focus)", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110789
2291