@doist/reactist 24.1.1-beta → 24.1.2-beta

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.
@@ -2653,6 +2653,10 @@ const ContextMenuTrigger = /*#__PURE__*/polymorphicComponent(function ContextMen
2653
2653
  });
2654
2654
  menuStore.show();
2655
2655
  }, [setAnchorRect, menuStore]);
2656
+ const isOpen = menuStore.useState('open');
2657
+ React.useEffect(() => {
2658
+ if (!isOpen) setAnchorRect(null);
2659
+ }, [isOpen, setAnchorRect]);
2656
2660
  return /*#__PURE__*/React.createElement(component, _objectSpread2(_objectSpread2({}, props), {}, {
2657
2661
  onContextMenu: handleContextMenu,
2658
2662
  ref
@@ -2683,15 +2687,7 @@ const MenuList = /*#__PURE__*/polymorphicComponent(function MenuList(_ref4, ref)
2683
2687
  ref: ref,
2684
2688
  className: classNames('reactist_menulist', exceptionallySetClassName),
2685
2689
  getAnchorRect: getAnchorRect != null ? getAnchorRect : undefined,
2686
- modal: modal,
2687
- onBlur: event => {
2688
- var _event$relatedTarget;
2689
-
2690
- if (!event.relatedTarget) return;
2691
- if (event.currentTarget.contains(event.relatedTarget)) return;
2692
- if ((_event$relatedTarget = event.relatedTarget) != null && _event$relatedTarget.closest('[role^="menu"]')) return;
2693
- menuStore.hide();
2694
- }
2690
+ modal: modal
2695
2691
  }))) : null;
2696
2692
  });
2697
2693
  /**
@@ -2768,12 +2764,11 @@ const SubMenu = /*#__PURE__*/React.forwardRef(function SubMenu({
2768
2764
  hide: parentMenuHide
2769
2765
  } = menuStore;
2770
2766
  const handleSubItemSelect = React.useCallback(function handleSubItemSelect(value) {
2771
- if (onItemSelect) onItemSelect(value);
2767
+ onItemSelect == null ? void 0 : onItemSelect(value);
2772
2768
  parentMenuItemSelect == null ? void 0 : parentMenuItemSelect(value);
2773
2769
  parentMenuHide();
2774
2770
  }, [parentMenuHide, parentMenuItemSelect, onItemSelect]);
2775
- const [button, list] = React.Children.toArray(children); // Ariakit needs to be able to pass props to the MenuButton
2776
- // and combine it with the MenuItem component
2771
+ const [button, list] = React.Children.toArray(children); // Ariakit needs to be able to pass props to the MenuButton and combine it with the MenuItem component
2777
2772
 
2778
2773
  const renderMenuButton = React.useCallback(function renderMenuButton(props) {
2779
2774
  return /*#__PURE__*/React.cloneElement(button, props);