@jsenv/navi 0.29.175 → 0.29.176

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.
@@ -46061,7 +46061,12 @@ const usePopupContentMount = (
46061
46061
  const anchorElement =
46062
46062
  typeof anchor === "string"
46063
46063
  ? document.getElementById(anchor)
46064
- : (anchor.current ?? anchor);
46064
+ : // A ref is unwrapped even when it holds nothing: an expandable with
46065
+ // no UI part hands an empty ref over, and the ref object itself is
46066
+ // truthy — it would reach addEventListener below and throw.
46067
+ "current" in anchor
46068
+ ? anchor.current
46069
+ : anchor;
46065
46070
  if (!anchorElement) {
46066
46071
  return undefined;
46067
46072
  }
@@ -58520,8 +58525,10 @@ const useDialogProps = props => {
58520
58525
  }
58521
58526
  } else if (anchor) {
58522
58527
  // anchor prop is a ref or a DOM element — always a real anchor,
58523
- // regardless of anchorCustomEventDetail.
58524
- anchorElement = anchor.current ?? anchor;
58528
+ // regardless of anchorCustomEventDetail. A ref is unwrapped even when it
58529
+ // holds nothing: falling back to the ref object itself would pass the
58530
+ // "is there an anchor?" test below with something that has no box.
58531
+ anchorElement = "current" in anchor ? anchor.current : anchor;
58525
58532
  } else if (anchorCustomEventDetail === "override") {
58526
58533
  // e.g. the button that triggered a --navi-toggle/--navi-open command,
58527
58534
  // already resolved from detail.anchor/detail.source by the caller
@@ -59931,8 +59938,10 @@ const usePopoverProps = props => {
59931
59938
  }
59932
59939
  } else if (anchor) {
59933
59940
  // anchor prop is a ref or a DOM element — always a real anchor,
59934
- // regardless of anchorCustomEventDetail.
59935
- anchorElement = anchor.current ?? anchor;
59941
+ // regardless of anchorCustomEventDetail. A ref is unwrapped even when it
59942
+ // holds nothing: falling back to the ref object itself would pass the
59943
+ // "is there an anchor?" test below with something that has no box.
59944
+ anchorElement = "current" in anchor ? anchor.current : anchor;
59936
59945
  } else if (anchorCustomEventDetail === "override") {
59937
59946
  anchorElement = e.detail.anchor;
59938
59947
  }