@absolutejs/beacon 0.6.37 → 0.6.38

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.js CHANGED
@@ -2024,6 +2024,11 @@ var createBeacon = (options) => {
2024
2024
  const firstGroup = first.closest(INTENTIONAL_CONTROL_GROUP_SELECTOR);
2025
2025
  return firstGroup !== null && firstGroup === second.closest(INTENTIONAL_CONTROL_GROUP_SELECTOR);
2026
2026
  };
2027
+ const crossesDialogBoundary = (first, second) => {
2028
+ const firstDialog = first.closest('[role="dialog"], dialog');
2029
+ const secondDialog = second.closest('[role="dialog"], dialog');
2030
+ return firstDialog === null !== (secondDialog === null);
2031
+ };
2027
2032
  const scanForControlCollisions = () => {
2028
2033
  const viewportWidth = document.documentElement.clientWidth;
2029
2034
  const viewportHeight = document.documentElement.clientHeight;
@@ -2054,7 +2059,7 @@ var createBeacon = (options) => {
2054
2059
  const second = controls[secondIndex];
2055
2060
  if (second === undefined)
2056
2061
  continue;
2057
- if (first.element.contains(second.element) || second.element.contains(first.element)) {
2062
+ if (first.element.contains(second.element) || second.element.contains(first.element) || crossesDialogBoundary(first.element, second.element)) {
2058
2063
  continue;
2059
2064
  }
2060
2065
  const overlapX = Math.min(first.rect.right, second.rect.right) - Math.max(first.rect.left, second.rect.left);
@@ -4134,5 +4139,5 @@ export {
4134
4139
  BEACON_ATTRIBUTE
4135
4140
  };
4136
4141
 
4137
- //# debugId=E29B0984FFB5596E64756E2164756E21
4142
+ //# debugId=F7889DDF767C94DD64756E2164756E21
4138
4143
  //# sourceMappingURL=index.js.map