@react-aria/interactions 3.0.0-nightly.1934 → 3.0.0-nightly.1954

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/main.js CHANGED
@@ -1262,10 +1262,12 @@ function $edcfa848c42f94f4$export$872b660ac5a1ff98(props) {
1262
1262
  }
1263
1263
  function $edcfa848c42f94f4$var$isValidEvent(event, ref) {
1264
1264
  if (event.button > 0) return false;
1265
- // if the event target is no longer in the document
1266
1265
  if (event.target) {
1266
+ // if the event target is no longer in the document, ignore
1267
1267
  const ownerDocument = event.target.ownerDocument;
1268
1268
  if (!ownerDocument || !ownerDocument.documentElement.contains(event.target)) return false;
1269
+ // If the target is within a top layer element (e.g. toasts), ignore.
1270
+ if (event.target.closest("[data-react-aria-top-layer]")) return false;
1269
1271
  }
1270
1272
  return ref.current && !ref.current.contains(event.target);
1271
1273
  }