@react-aria/interactions 3.0.0-nightly.1659 → 3.0.0-nightly.1662

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
@@ -43,7 +43,7 @@ function $f7e14e656343df57$export$16a4697467175487(target) {
43
43
  document.documentElement.style.webkitUserSelect = 'none';
44
44
  }
45
45
  $f7e14e656343df57$var$state = 'disabled';
46
- } else if (target) {
46
+ } else if (target instanceof HTMLElement || target instanceof SVGElement) {
47
47
  // If not iOS, store the target's original user-select and change to user-select: none
48
48
  // Ignore state since it doesn't apply for non iOS
49
49
  $f7e14e656343df57$var$modifiedElementMap.set(target, target.style.userSelect);
@@ -70,13 +70,15 @@ function $f7e14e656343df57$export$b0d6fa1ab32e3295(target) {
70
70
  }
71
71
  });
72
72
  }, 300);
73
- } else // If not iOS, restore the target's original user-select if any
73
+ } else if (target instanceof HTMLElement || target instanceof SVGElement) // If not iOS, restore the target's original user-select if any
74
74
  // Ignore state since it doesn't apply for non iOS
75
- if (target && $f7e14e656343df57$var$modifiedElementMap.has(target)) {
76
- let targetOldUserSelect = $f7e14e656343df57$var$modifiedElementMap.get(target);
77
- if (target.style.userSelect === 'none') target.style.userSelect = targetOldUserSelect;
78
- if (target.getAttribute('style') === '') target.removeAttribute('style');
79
- $f7e14e656343df57$var$modifiedElementMap.delete(target);
75
+ {
76
+ if (target && $f7e14e656343df57$var$modifiedElementMap.has(target)) {
77
+ let targetOldUserSelect = $f7e14e656343df57$var$modifiedElementMap.get(target);
78
+ if (target.style.userSelect === 'none') target.style.userSelect = targetOldUserSelect;
79
+ if (target.getAttribute('style') === '') target.removeAttribute('style');
80
+ $f7e14e656343df57$var$modifiedElementMap.delete(target);
81
+ }
80
82
  }
81
83
  }
82
84
 
@@ -84,7 +86,6 @@ function $f7e14e656343df57$export$b0d6fa1ab32e3295(target) {
84
86
 
85
87
 
86
88
 
87
-
88
89
  function $625cf83917e112ad$export$60278871457622de(event) {
89
90
  // JAWS/NVDA with Firefox.
90
91
  if (event.mozInputSource === 0 && event.isTrusted) return true;
@@ -188,6 +189,7 @@ const $01d3f539e91688c8$export$5165eccb35aaadb5 = ($parcel$interopDefault($goTMa
188
189
  $01d3f539e91688c8$export$5165eccb35aaadb5.displayName = 'PressResponderContext';
189
190
 
190
191
 
192
+
191
193
  function $0294ea432cd92340$var$usePressResponderContext(props) {
192
194
  // Consume context from <PressResponder> and merge with props.
193
195
  let context = $goTMa$react.useContext($01d3f539e91688c8$export$5165eccb35aaadb5);
@@ -342,7 +344,7 @@ function $0294ea432cd92340$export$45712eceda6fad21(props) {
342
344
  removeAllGlobalListeners();
343
345
  // If the target is a link, trigger the click method to open the URL,
344
346
  // but defer triggering pressEnd until onClick event handler.
345
- if (state.target.contains(target) && $0294ea432cd92340$var$isHTMLAnchorLink(state.target) || state.target.getAttribute('role') === 'link') state.target.click();
347
+ if (state.target instanceof HTMLElement && (state.target.contains(target) && $0294ea432cd92340$var$isHTMLAnchorLink(state.target) || state.target.getAttribute('role') === 'link')) state.target.click();
346
348
  }
347
349
  };
348
350
  if (typeof PointerEvent !== 'undefined') {
@@ -630,7 +632,7 @@ function $0294ea432cd92340$var$isOverTarget(point, target) {
630
632
  }
631
633
  function $0294ea432cd92340$var$shouldPreventDefault(target) {
632
634
  // We cannot prevent default if the target is a draggable element.
633
- return !target.draggable;
635
+ return !(target instanceof HTMLElement) || !target.draggable;
634
636
  }
635
637
  function $0294ea432cd92340$var$shouldPreventDefaultKeyboard(target) {
636
638
  return !((target.tagName === 'INPUT' || target.tagName === 'BUTTON') && target.type === 'submit');