@sanity/ui 2.0.0-beta.3 → 2.0.0-beta.4
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.js
CHANGED
|
@@ -6345,6 +6345,9 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
6345
6345
|
setOpen(v => !v);
|
|
6346
6346
|
setShouldFocus(null);
|
|
6347
6347
|
}, []);
|
|
6348
|
+
const handleMouseDown = react.useCallback(event => {
|
|
6349
|
+
if (open) event.preventDefault();
|
|
6350
|
+
}, [open]);
|
|
6348
6351
|
const handleButtonKeyDown = react.useCallback(event => {
|
|
6349
6352
|
if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
|
|
6350
6353
|
event.preventDefault();
|
|
@@ -6428,11 +6431,12 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
6428
6431
|
id,
|
|
6429
6432
|
onClick: handleButtonClick,
|
|
6430
6433
|
onKeyDown: handleButtonKeyDown,
|
|
6434
|
+
onMouseDown: handleMouseDown,
|
|
6431
6435
|
"aria-haspopup": true,
|
|
6432
6436
|
"aria-expanded": open,
|
|
6433
6437
|
ref: setButtonRef,
|
|
6434
6438
|
selected: open
|
|
6435
|
-
}) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, id, open, setButtonRef]);
|
|
6439
|
+
}) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, handleMouseDown, id, open, setButtonRef]);
|
|
6436
6440
|
const popoverProps = react.useMemo(() => ({
|
|
6437
6441
|
boundaryElement: deprecated_boundaryElement,
|
|
6438
6442
|
overflow: "auto",
|