@sanity/ui 2.8.1 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +15 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/components/dialog/dialog.tsx +12 -9
- package/src/core/components/menu/menu.tsx +7 -1
package/dist/index.js
CHANGED
|
@@ -5143,11 +5143,14 @@ const Root$7 = styledComponents.styled(Layer)(responsivePaddingStyle, dialogStyl
|
|
|
5143
5143
|
[boundaryElement, isTopLayer, onClose, portalElement]
|
|
5144
5144
|
)
|
|
5145
5145
|
), useClickOutside(
|
|
5146
|
-
(
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5146
|
+
react.useCallback(
|
|
5147
|
+
(event) => {
|
|
5148
|
+
if (!isTopLayer || !onClickOutside) return;
|
|
5149
|
+
const target = event.target;
|
|
5150
|
+
target && !isTargetWithinScope(boundaryElement, portalElement, target) || onClickOutside();
|
|
5151
|
+
},
|
|
5152
|
+
[boundaryElement, isTopLayer, onClickOutside, portalElement]
|
|
5153
|
+
),
|
|
5151
5154
|
[rootElement]
|
|
5152
5155
|
);
|
|
5153
5156
|
const setRef = react.useCallback((el) => {
|
|
@@ -5484,7 +5487,13 @@ const Root$5 = styledComponents.styled(Box)`
|
|
|
5484
5487
|
);
|
|
5485
5488
|
react.useEffect(() => {
|
|
5486
5489
|
onItemSelect && onItemSelect(activeIndex);
|
|
5487
|
-
}, [activeIndex, onItemSelect]), useClickOutside(
|
|
5490
|
+
}, [activeIndex, onItemSelect]), useClickOutside(
|
|
5491
|
+
react.useCallback(
|
|
5492
|
+
(event) => isTopLayer && onClickOutside && onClickOutside(event),
|
|
5493
|
+
[isTopLayer, onClickOutside]
|
|
5494
|
+
),
|
|
5495
|
+
[rootElement]
|
|
5496
|
+
), useGlobalKeyDown(
|
|
5488
5497
|
react.useCallback(
|
|
5489
5498
|
(event) => {
|
|
5490
5499
|
isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
|