@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.
package/components.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2024-04-15T13:01:29",
2
+ "timestamp": "2024-04-16T12:14:49",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "3.3.1",
@@ -93,6 +93,7 @@ const SwirlPopover = class {
93
93
  const target = event.target;
94
94
  const relatedTarget = event.relatedTarget;
95
95
  const activeElement = utils.getActiveElement();
96
+ const swirlComponentsExcludedFromAutoClosing = ["SWIRL-TAB"];
96
97
  // Check if the focus has moved outside the popover or its trigger.
97
98
  const focusIsOutsidePopover = !this.el.contains(target) && !this.el.contains(activeElement);
98
99
  const focusIsNotOnTrigger = target !== this.triggerEl && !this.triggerEl?.contains(target);
@@ -100,7 +101,8 @@ const SwirlPopover = class {
100
101
  !this.el.contains(relatedTarget || target) &&
101
102
  relatedTarget !== this.el;
102
103
  // Close the popover if the focus is outside and additional checks for Safari or WKWebView pass.
103
- if (focusIsOutsidePopover &&
104
+ if (!swirlComponentsExcludedFromAutoClosing.includes(target.tagName) &&
105
+ focusIsOutsidePopover &&
104
106
  focusIsNotOnTrigger &&
105
107
  (!isSafariOrWKWebView || extraCheckForSafariOrWKWebView)) {
106
108
  this.close();