focus-lock
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -14,3 +14,3 @@ declare type SetRef = () => Element | null; | ||
}; | ||
export declare const recordElementLocation: (element: Element) => Location; | ||
export declare const recordElementLocation: (element: Element | null) => Location | null; | ||
/** | ||
@@ -23,3 +23,3 @@ * Captures the current focused element to restore focus as close as possible in the future | ||
*/ | ||
export declare const captureFocusRestore: (targetElement: Element) => (() => Element | undefined); | ||
export declare const captureFocusRestore: (targetElement: Element | null) => (() => Element | undefined); | ||
export {}; |
@@ -9,2 +9,5 @@ import { getTabbableNodes } from './utils/DOMutils'; | ||
export var recordElementLocation = function (element) { | ||
if (!element) { | ||
return null; | ||
} | ||
var stack = []; | ||
@@ -29,2 +32,5 @@ var currentElement = element; | ||
var _a, _b, _c, _d, _e; | ||
if (!location) { | ||
return undefined; | ||
} | ||
var stack = location.stack, ownerDocument = location.ownerDocument; | ||
@@ -31,0 +37,0 @@ var visibilityCache = new Map(); |
@@ -14,3 +14,3 @@ declare type SetRef = () => Element | null; | ||
}; | ||
export declare const recordElementLocation: (element: Element) => Location; | ||
export declare const recordElementLocation: (element: Element | null) => Location | null; | ||
/** | ||
@@ -23,3 +23,3 @@ * Captures the current focused element to restore focus as close as possible in the future | ||
*/ | ||
export declare const captureFocusRestore: (targetElement: Element) => (() => Element | undefined); | ||
export declare const captureFocusRestore: (targetElement: Element | null) => (() => Element | undefined); | ||
export {}; |
@@ -9,2 +9,5 @@ import { getTabbableNodes } from './utils/DOMutils'; | ||
export const recordElementLocation = (element) => { | ||
if (!element) { | ||
return null; | ||
} | ||
const stack = []; | ||
@@ -29,2 +32,5 @@ let currentElement = element; | ||
var _a, _b, _c, _d, _e; | ||
if (!location) { | ||
return undefined; | ||
} | ||
const { stack, ownerDocument } = location; | ||
@@ -31,0 +37,0 @@ const visibilityCache = new Map(); |
@@ -14,3 +14,3 @@ declare type SetRef = () => Element | null; | ||
}; | ||
export declare const recordElementLocation: (element: Element) => Location; | ||
export declare const recordElementLocation: (element: Element | null) => Location | null; | ||
/** | ||
@@ -23,3 +23,3 @@ * Captures the current focused element to restore focus as close as possible in the future | ||
*/ | ||
export declare const captureFocusRestore: (targetElement: Element) => (() => Element | undefined); | ||
export declare const captureFocusRestore: (targetElement: Element | null) => (() => Element | undefined); | ||
export {}; |
@@ -12,2 +12,5 @@ "use strict"; | ||
var recordElementLocation = function (element) { | ||
if (!element) { | ||
return null; | ||
} | ||
var stack = []; | ||
@@ -33,2 +36,5 @@ var currentElement = element; | ||
var _a, _b, _c, _d, _e; | ||
if (!location) { | ||
return undefined; | ||
} | ||
var stack = location.stack, ownerDocument = location.ownerDocument; | ||
@@ -35,0 +41,0 @@ var visibilityCache = new Map(); |
{ | ||
"name": "focus-lock", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "DOM trap for a focus", | ||
@@ -5,0 +5,0 @@ "main": "dist/es5/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
185274
4413