@clayui/shared
Advanced tools
Comparing version 3.116.0 to 3.119.0
@@ -8,2 +8,3 @@ /** | ||
children: React.ReactElement; | ||
inert?: boolean; | ||
isCloseOnInteractOutside?: boolean; | ||
@@ -25,3 +26,3 @@ isKeyboardDismiss?: boolean; | ||
*/ | ||
export declare function Overlay({ children, isCloseOnInteractOutside, isKeyboardDismiss, isModal, isOpen, menuClassName, menuRef, onClose, portalRef, suppress, triggerRef, }: Props): JSX.Element; | ||
export declare function Overlay({ children, inert, isCloseOnInteractOutside, isKeyboardDismiss, isModal, isOpen, menuClassName, menuRef, onClose, portalRef, suppress, triggerRef, }: Props): JSX.Element; | ||
export {}; |
@@ -37,2 +37,3 @@ "use strict"; | ||
var children = _ref.children, | ||
inert = _ref.inert, | ||
_ref$isCloseOnInterac = _ref.isCloseOnInteractOutside, | ||
@@ -91,2 +92,7 @@ isCloseOnInteractOutside = _ref$isCloseOnInterac === void 0 ? false : _ref$isCloseOnInterac, | ||
onInteractStart: function onInteractStart(event) { | ||
if (unsuppressCallbackRef.current) { | ||
unsuppressCallbackRef.current(); | ||
unsuppressCallbackRef.current = null; | ||
} | ||
if (overlayStack[overlayStack.length - 1] === menuRef && isModal) { | ||
@@ -121,16 +127,17 @@ event.stopPropagation(); | ||
if (isModal && (0, _ariaHidden.supportsInert)()) { | ||
if ((isModal || inert) && (0, _ariaHidden.supportsInert)()) { | ||
unsuppressCallbackRef.current = (0, _ariaHidden.suppressOthers)(elements); | ||
return function () { | ||
if (unsuppressCallbackRef.current) { | ||
unsuppressCallbackRef.current(); | ||
} | ||
unsuppressCallbackRef.current = null; | ||
}; | ||
} else { | ||
return (0, _ariaHidden.hideOthers)(elements); | ||
unsuppressCallbackRef.current = (0, _ariaHidden.hideOthers)(elements); | ||
} | ||
return function () { | ||
if (unsuppressCallbackRef.current) { | ||
unsuppressCallbackRef.current(); | ||
} | ||
unsuppressCallbackRef.current = null; | ||
}; | ||
} | ||
}, [isModal, isOpen]); | ||
}, [isModal, inert, isOpen]); | ||
return /*#__PURE__*/_react.default.createElement(_Portal.ClayPortal, { | ||
@@ -140,7 +147,5 @@ className: menuClassName, | ||
}, isModal && /*#__PURE__*/_react.default.createElement("span", { | ||
"aria-hidden": "true", | ||
"data-focus-scope-start": "true", | ||
tabIndex: 0 | ||
}), children, isModal && /*#__PURE__*/_react.default.createElement("span", { | ||
"aria-hidden": "true", | ||
"data-focus-scope-end": "true", | ||
@@ -147,0 +152,0 @@ tabIndex: 0 |
{ | ||
"name": "@clayui/shared", | ||
"version": "3.116.0", | ||
"version": "3.119.0", | ||
"description": "ClayShared component", | ||
@@ -43,3 +43,3 @@ "license": "BSD-3-Clause", | ||
], | ||
"gitHead": "235780a282ba87864ce556f8004571af102ff165" | ||
"gitHead": "d7bffea85cd618678d0481131fb20d09c70b725e" | ||
} |
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
2560
109877
58