@plasmicpkgs/react-aria 0.0.94 → 0.0.95

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.
@@ -2150,6 +2150,8 @@ function BasePopover(props) {
2150
2150
  const triggerRef = React.useRef(null);
2151
2151
  const canvasContext = usePlasmicCanvasContext();
2152
2152
  const matchTriggerWidthProp = hasTrigger && matchTriggerWidth;
2153
+ const dialogTriggerContext = React.useContext(PlasmicDialogTriggerContext);
2154
+ const shouldTrapFocus = !canvasContext && !!dialogTriggerContext;
2153
2155
  const _b = mergeProps$1(
2154
2156
  {
2155
2157
  // isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.
@@ -2172,7 +2174,7 @@ function BasePopover(props) {
2172
2174
  canMatchTriggerWidth: hasTrigger
2173
2175
  });
2174
2176
  }, [hasTrigger, setControlContextData]);
2175
- const dialogInCanvas = /* @__PURE__ */ React.createElement("div", null, children);
2177
+ const withoutDialog = /* @__PURE__ */ React.createElement("div", null, children);
2176
2178
  const dialog = /* @__PURE__ */ React.createElement(Dialog, null, children);
2177
2179
  return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(
2178
2180
  Popover,
@@ -2180,7 +2182,7 @@ function BasePopover(props) {
2180
2182
  style: __spreadValues$g(__spreadValues$g({}, matchTriggerWidthProp ? { width: `var(--trigger-width)` } : {}), COMMON_STYLES)
2181
2183
  }, mergedProps),
2182
2184
  ({ placement }) => withObservedValues$a(
2183
- canvasContext || isStandalone ? dialogInCanvas : dialog,
2185
+ shouldTrapFocus ? dialog : withoutDialog,
2184
2186
  {
2185
2187
  placementTop: placement === "top",
2186
2188
  placementBottom: placement === "bottom",