@absolutejs/beacon 0.6.3 → 0.6.4

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
@@ -2754,7 +2754,17 @@ var createBeacon = (options) => {
2754
2754
  if (signals.modalFocusEscape !== false && target instanceof Element) {
2755
2755
  const modals = openModals();
2756
2756
  if (modals.length > 0 && !modals.some((modal) => modal.contains(target))) {
2757
- reportModalEscape(modals[modals.length - 1], target, "escaped");
2757
+ const modal = modals[modals.length - 1];
2758
+ const timer2 = setTimeout(() => {
2759
+ modalTimers.delete(timer2);
2760
+ if (!isRenderedModal(modal))
2761
+ return;
2762
+ const active = document.activeElement instanceof Element ? document.activeElement : null;
2763
+ if (active !== null && modal.contains(active))
2764
+ return;
2765
+ reportModalEscape(modal, active, "escaped");
2766
+ }, 0);
2767
+ modalTimers.add(timer2);
2758
2768
  }
2759
2769
  }
2760
2770
  lastDialogFocus = target instanceof Element && target.closest(DIALOG_SELECTOR) !== null ? target : null;
@@ -3566,5 +3576,5 @@ export {
3566
3576
  BEACON_ATTRIBUTE
3567
3577
  };
3568
3578
 
3569
- //# debugId=92AD5D46269906F564756E2164756E21
3579
+ //# debugId=9A47E9967A8B159F64756E2164756E21
3570
3580
  //# sourceMappingURL=index.js.map