@dloizides/ui-nav 1.13.0 → 1.13.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.
package/dist/index.mjs CHANGED
@@ -1048,6 +1048,10 @@ var SCRIM_Z_INDEX = 1;
1048
1048
  var PANEL_Z_INDEX = 2;
1049
1049
  var NAV_ACTIVATABLE_SELECTOR = 'a, [role="button"], [role="link"]';
1050
1050
  var NAV_TOGGLE_SELECTOR = "[aria-expanded]";
1051
+ function deferClose(close) {
1052
+ if (typeof setTimeout === "function") setTimeout(close, 0);
1053
+ else close();
1054
+ }
1051
1055
  var DEFAULT_DRAWER_LABELS = {
1052
1056
  openLabel: "Menu",
1053
1057
  openHint: "Open the navigation menu",
@@ -1113,7 +1117,7 @@ var MobileDrawer = ({
1113
1117
  if (target === null) return;
1114
1118
  const activatable = target.closest(NAV_ACTIVATABLE_SELECTOR);
1115
1119
  const isToggle = activatable !== null && activatable.closest(NAV_TOGGLE_SELECTOR) !== null;
1116
- if (activatable !== null && !isToggle) onClose();
1120
+ if (activatable !== null && !isToggle) deferClose(onClose);
1117
1121
  };
1118
1122
  node.addEventListener("click", handleClick);
1119
1123
  return () => node.removeEventListener("click", handleClick);