@linzjs/step-ag-grid 2.3.0 → 2.3.1

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.
@@ -1303,12 +1303,12 @@ var ControlledMenuFr = function (_a, externalRef) {
1303
1303
  reposition,
1304
1304
  viewScroll,
1305
1305
  ]);
1306
- var clickIsWithinMenu = useCallback(function (ev) {
1307
- return hasParentClass("szh-menu--state-open", ev.target) ||
1308
- (closeMenuExclusionClassName && hasParentClass(closeMenuExclusionClassName, ev.target));
1306
+ var isWithinMenu = useCallback(function (target) {
1307
+ return hasParentClass("szh-menu--state-open", target) ||
1308
+ (closeMenuExclusionClassName && hasParentClass(closeMenuExclusionClassName, target));
1309
1309
  }, [closeMenuExclusionClassName]);
1310
1310
  var handleScreenEventForSave = useCallback(function (ev) {
1311
- if (!clickIsWithinMenu(ev)) {
1311
+ if (!isWithinMenu(ev.target)) {
1312
1312
  ev.preventDefault();
1313
1313
  ev.stopPropagation();
1314
1314
  // FIXME There's an issue in React17
@@ -1330,13 +1330,13 @@ var ControlledMenuFr = function (_a, externalRef) {
1330
1330
  setTimeout(function () { return (skipOpen.current = false); }, 300);
1331
1331
  }
1332
1332
  }
1333
- }, [clickIsWithinMenu, onClose, saveButtonRef, skipOpen]);
1333
+ }, [isWithinMenu, onClose, saveButtonRef, skipOpen]);
1334
1334
  var handleScreenEventForCancel = useCallback(function (ev) {
1335
- if (!clickIsWithinMenu(ev)) {
1335
+ if (!isWithinMenu(ev.target)) {
1336
1336
  ev.preventDefault();
1337
1337
  ev.stopPropagation();
1338
1338
  }
1339
- }, [clickIsWithinMenu]);
1339
+ }, [isWithinMenu]);
1340
1340
  useEffect(function () {
1341
1341
  if (isMenuOpen(state)) {
1342
1342
  var thisDocument_1 = (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) ? anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current.ownerDocument : document;
@@ -1389,7 +1389,9 @@ var ControlledMenuFr = function (_a, externalRef) {
1389
1389
  }
1390
1390
  };
1391
1391
  var onBlur = function (e) {
1392
- if (isMenuOpen(state) && !e.currentTarget.contains(e.relatedTarget || document.activeElement)) {
1392
+ if (isMenuOpen(state) &&
1393
+ !e.currentTarget.contains(e.relatedTarget || document.activeElement) &&
1394
+ !isWithinMenu(e.relatedTarget)) {
1393
1395
  safeCall(onClose, { reason: CloseReason.BLUR });
1394
1396
  // If a user clicks on the menu button when a menu is open, we need to close the menu.
1395
1397
  // However, a blur event will be fired prior to the click event on menu button,
@@ -2709,8 +2711,6 @@ var useGridPopoverHook = function (props) {
2709
2711
  }); }, [props, stopEditing, propsRef]);
2710
2712
  var popoverWrapper = useCallback(function (children) {
2711
2713
  return (jsx(Fragment$1, { children: anchorRef.current && (jsxs(ControlledMenu, __assign({ state: isOpen ? "open" : "closed", portal: true, unmountOnClose: true, anchorRef: anchorRef, saveButtonRef: saveButtonRef, menuClassName: "step-ag-grid-react-menu", onClose: function (event) {
2712
- if (event.reason === "blur")
2713
- return;
2714
2714
  triggerSave(event.reason).then();
2715
2715
  }, viewScroll: "auto", dontShrinkIfDirectionIsTop: true, className: props.className, closeMenuExclusionClassName: "ReactModal__Content" }, { children: [saving && ( // This is the overlay that prevents editing when the editor is saving
2716
2716
  jsx("div", { style: {