Files
url_tracker_tool/node_modules/focus-lock/dist/es2015/focusIsHidden.js
Andrei 58f8093689 Rebrand from 'Redirect Intelligence v2' to 'URL Tracker Tool V2' throughout UI
- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
2025-08-19 19:12:23 +00:00

22 lines
869 B
JavaScript

import { FOCUS_ALLOW } from './constants';
import { contains } from './utils/DOMutils';
import { toArray } from './utils/array';
import { getActiveElement } from './utils/getActiveElement';
/**
* checks if focus is hidden FROM the focus-lock
* ie contained inside a node focus-lock shall ignore
*
* This is a utility function coupled with {@link FOCUS_ALLOW} constant
*
* @returns {boolean} focus is currently is in "allow" area
*/
export var focusIsHidden = function (inDocument) {
if (inDocument === void 0) { inDocument = document; }
var activeElement = getActiveElement(inDocument);
if (!activeElement) {
return false;
}
// this does not support setting FOCUS_ALLOW within shadow dom
return toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW, "]"))).some(function (node) { return contains(node, activeElement); });
};