@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.esm.js CHANGED
@@ -6332,6 +6332,9 @@ const MenuButton = forwardRef(function MenuButton2(props, ref) {
6332
6332
  setOpen(v => !v);
6333
6333
  setShouldFocus(null);
6334
6334
  }, []);
6335
+ const handleMouseDown = useCallback(event => {
6336
+ if (open) event.preventDefault();
6337
+ }, [open]);
6335
6338
  const handleButtonKeyDown = useCallback(event => {
6336
6339
  if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
6337
6340
  event.preventDefault();
@@ -6415,11 +6418,12 @@ const MenuButton = forwardRef(function MenuButton2(props, ref) {
6415
6418
  id,
6416
6419
  onClick: handleButtonClick,
6417
6420
  onKeyDown: handleButtonKeyDown,
6421
+ onMouseDown: handleMouseDown,
6418
6422
  "aria-haspopup": true,
6419
6423
  "aria-expanded": open,
6420
6424
  ref: setButtonRef,
6421
6425
  selected: open
6422
- }) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, id, open, setButtonRef]);
6426
+ }) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, handleMouseDown, id, open, setButtonRef]);
6423
6427
  const popoverProps = useMemo(() => ({
6424
6428
  boundaryElement: deprecated_boundaryElement,
6425
6429
  overflow: "auto",