Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (observed.current !== newObserved) {
observed.current = newObserved;
setObserved(newObserved);
}
}, []);
if (process.env.NODE_ENV !== 'production') {
if (typeof allowTextSelection !== 'undefined') {
// eslint-disable-next-line no-console
console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');
}
}
const lockProps = {
[constants.FOCUS_DISABLED]: disabled && 'disabled',
[constants.FOCUS_GROUP]: group,
...containerProps,
};
const hasLeadingGuards = noFocusGuards !== true;
const hasTailingGuards = hasLeadingGuards && (noFocusGuards !== 'tail');
return (
{hasLeadingGuards && [
<div style="{hiddenGuard}" tabindex="{disabled" data-focus-guard="">, // nearest focus guard
<div style="{hiddenGuard}" tabindex="{disabled" data-focus-guard="">, // first tabbed element guard
]}
</div></div>