@getflip/swirl-components 0.184.2 → 0.184.3

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.
@@ -86,6 +86,7 @@ export class SwirlPopover {
86
86
  const target = event.target;
87
87
  const relatedTarget = event.relatedTarget;
88
88
  const activeElement = getActiveElement();
89
+ const swirlComponentsExcludedFromAutoClosing = ["SWIRL-TAB"];
89
90
  // Check if the focus has moved outside the popover or its trigger.
90
91
  const focusIsOutsidePopover = !this.el.contains(target) && !this.el.contains(activeElement);
91
92
  const focusIsNotOnTrigger = target !== this.triggerEl && !this.triggerEl?.contains(target);
@@ -93,7 +94,8 @@ export class SwirlPopover {
93
94
  !this.el.contains(relatedTarget || target) &&
94
95
  relatedTarget !== this.el;
95
96
  // Close the popover if the focus is outside and additional checks for Safari or WKWebView pass.
96
- if (focusIsOutsidePopover &&
97
+ if (!swirlComponentsExcludedFromAutoClosing.includes(target.tagName) &&
98
+ focusIsOutsidePopover &&
97
99
  focusIsNotOnTrigger &&
98
100
  (!isSafariOrWKWebView || extraCheckForSafariOrWKWebView)) {
99
101
  this.close();