@react-aria/interactions
Advanced tools
Comparing version 3.0.0-nightly-262cc758b-241115 to 3.0.0-nightly-326f48154-241212
@@ -282,3 +282,6 @@ var $f7e14e656343df57$exports = require("./textSelection.main.js"); | ||
shouldStopPropagation = triggerPressStart(e, state.pointerType); | ||
addGlobalListener((0, $bBqCQ$reactariautils.getOwnerDocument)(e.currentTarget), 'pointermove', onPointerMove, false); | ||
// Release pointer capture so that touch interactions can leave the original target. | ||
// This enables onPointerLeave and onPointerEnter to fire. | ||
let target = e.target; | ||
if ('releasePointerCapture' in target) target.releasePointerCapture(e.pointerId); | ||
addGlobalListener((0, $bBqCQ$reactariautils.getOwnerDocument)(e.currentTarget), 'pointerup', onPointerUp, false); | ||
@@ -303,17 +306,12 @@ addGlobalListener((0, $bBqCQ$reactariautils.getOwnerDocument)(e.currentTarget), 'pointercancel', onPointerCancel, false); | ||
// Only handle left clicks | ||
// Safari on iOS sometimes fires pointerup events, even | ||
// when the touch isn't over the target, so double check. | ||
if (e.button === 0 && $0294ea432cd92340$var$isOverTarget(e, e.currentTarget)) triggerPressUp(e, state.pointerType || e.pointerType); | ||
if (e.button === 0) triggerPressUp(e, state.pointerType || e.pointerType); | ||
}; | ||
// Safari on iOS < 13.2 does not implement pointerenter/pointerleave events correctly. | ||
// Use pointer move events instead to implement our own hit testing. | ||
// See https://bugs.webkit.org/show_bug.cgi?id=199803 | ||
let onPointerMove = (e)=>{ | ||
if (e.pointerId !== state.activePointerId) return; | ||
if (state.target && $0294ea432cd92340$var$isOverTarget(e, state.target)) { | ||
if (!state.isOverTarget && state.pointerType != null) { | ||
state.isOverTarget = true; | ||
triggerPressStart($0294ea432cd92340$var$createEvent(state.target, e), state.pointerType); | ||
} | ||
} else if (state.target && state.isOverTarget && state.pointerType != null) { | ||
pressProps.onPointerEnter = (e)=>{ | ||
if (e.pointerId === state.activePointerId && state.target && !state.isOverTarget && state.pointerType != null) { | ||
state.isOverTarget = true; | ||
triggerPressStart($0294ea432cd92340$var$createEvent(state.target, e), state.pointerType); | ||
} | ||
}; | ||
pressProps.onPointerLeave = (e)=>{ | ||
if (e.pointerId === state.activePointerId && state.target && state.isOverTarget && state.pointerType != null) { | ||
state.isOverTarget = false; | ||
@@ -326,3 +324,3 @@ triggerPressEnd($0294ea432cd92340$var$createEvent(state.target, e), state.pointerType, false); | ||
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) { | ||
if ($0294ea432cd92340$var$isOverTarget(e, state.target) && state.pointerType != null) triggerPressEnd($0294ea432cd92340$var$createEvent(state.target, e), state.pointerType); | ||
if (state.target.contains(e.target) && state.pointerType != null) triggerPressEnd($0294ea432cd92340$var$createEvent(state.target, e), state.pointerType); | ||
else if (state.isOverTarget && state.pointerType != null) triggerPressEnd($0294ea432cd92340$var$createEvent(state.target, e), state.pointerType, false); | ||
@@ -329,0 +327,0 @@ state.isPressed = false; |
@@ -276,3 +276,6 @@ import {disableTextSelection as $14c0b72509d70225$export$16a4697467175487, restoreTextSelection as $14c0b72509d70225$export$b0d6fa1ab32e3295} from "./textSelection.module.js"; | ||
shouldStopPropagation = triggerPressStart(e, state.pointerType); | ||
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'pointermove', onPointerMove, false); | ||
// Release pointer capture so that touch interactions can leave the original target. | ||
// This enables onPointerLeave and onPointerEnter to fire. | ||
let target = e.target; | ||
if ('releasePointerCapture' in target) target.releasePointerCapture(e.pointerId); | ||
addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'pointerup', onPointerUp, false); | ||
@@ -297,17 +300,12 @@ addGlobalListener((0, $7mdmh$getOwnerDocument)(e.currentTarget), 'pointercancel', onPointerCancel, false); | ||
// Only handle left clicks | ||
// Safari on iOS sometimes fires pointerup events, even | ||
// when the touch isn't over the target, so double check. | ||
if (e.button === 0 && $f6c31cce2adf654f$var$isOverTarget(e, e.currentTarget)) triggerPressUp(e, state.pointerType || e.pointerType); | ||
if (e.button === 0) triggerPressUp(e, state.pointerType || e.pointerType); | ||
}; | ||
// Safari on iOS < 13.2 does not implement pointerenter/pointerleave events correctly. | ||
// Use pointer move events instead to implement our own hit testing. | ||
// See https://bugs.webkit.org/show_bug.cgi?id=199803 | ||
let onPointerMove = (e)=>{ | ||
if (e.pointerId !== state.activePointerId) return; | ||
if (state.target && $f6c31cce2adf654f$var$isOverTarget(e, state.target)) { | ||
if (!state.isOverTarget && state.pointerType != null) { | ||
state.isOverTarget = true; | ||
triggerPressStart($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType); | ||
} | ||
} else if (state.target && state.isOverTarget && state.pointerType != null) { | ||
pressProps.onPointerEnter = (e)=>{ | ||
if (e.pointerId === state.activePointerId && state.target && !state.isOverTarget && state.pointerType != null) { | ||
state.isOverTarget = true; | ||
triggerPressStart($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType); | ||
} | ||
}; | ||
pressProps.onPointerLeave = (e)=>{ | ||
if (e.pointerId === state.activePointerId && state.target && state.isOverTarget && state.pointerType != null) { | ||
state.isOverTarget = false; | ||
@@ -320,3 +318,3 @@ triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false); | ||
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) { | ||
if ($f6c31cce2adf654f$var$isOverTarget(e, state.target) && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType); | ||
if (state.target.contains(e.target) && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType); | ||
else if (state.isOverTarget && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false); | ||
@@ -323,0 +321,0 @@ state.isPressed = false; |
{ | ||
"name": "@react-aria/interactions", | ||
"version": "3.0.0-nightly-262cc758b-241115", | ||
"version": "3.0.0-nightly-326f48154-241212", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,14 +25,13 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/ssr": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-aria/utils": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-types/shared": "^3.0.0-nightly-262cc758b-241115", | ||
"@react-aria/ssr": "3.0.0-nightly-326f48154-241212", | ||
"@react-aria/utils": "3.0.0-nightly-326f48154-241212", | ||
"@react-types/shared": "3.0.0-nightly-326f48154-241212", | ||
"@swc/helpers": "^0.5.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"stableVersion": "3.22.4" | ||
} | ||
} |
@@ -436,3 +436,9 @@ /* | ||
addGlobalListener(getOwnerDocument(e.currentTarget), 'pointermove', onPointerMove, false); | ||
// Release pointer capture so that touch interactions can leave the original target. | ||
// This enables onPointerLeave and onPointerEnter to fire. | ||
let target = e.target as Element; | ||
if ('releasePointerCapture' in target) { | ||
target.releasePointerCapture(e.pointerId); | ||
} | ||
addGlobalListener(getOwnerDocument(e.currentTarget), 'pointerup', onPointerUp, false); | ||
@@ -471,5 +477,3 @@ addGlobalListener(getOwnerDocument(e.currentTarget), 'pointercancel', onPointerCancel, false); | ||
// Only handle left clicks | ||
// Safari on iOS sometimes fires pointerup events, even | ||
// when the touch isn't over the target, so double check. | ||
if (e.button === 0 && isOverTarget(e, e.currentTarget)) { | ||
if (e.button === 0) { | ||
triggerPressUp(e, state.pointerType || e.pointerType); | ||
@@ -479,16 +483,11 @@ } | ||
// Safari on iOS < 13.2 does not implement pointerenter/pointerleave events correctly. | ||
// Use pointer move events instead to implement our own hit testing. | ||
// See https://bugs.webkit.org/show_bug.cgi?id=199803 | ||
let onPointerMove = (e: PointerEvent) => { | ||
if (e.pointerId !== state.activePointerId) { | ||
return; | ||
pressProps.onPointerEnter = (e) => { | ||
if (e.pointerId === state.activePointerId && state.target && !state.isOverTarget && state.pointerType != null) { | ||
state.isOverTarget = true; | ||
triggerPressStart(createEvent(state.target, e), state.pointerType); | ||
} | ||
}; | ||
if (state.target && isOverTarget(e, state.target)) { | ||
if (!state.isOverTarget && state.pointerType != null) { | ||
state.isOverTarget = true; | ||
triggerPressStart(createEvent(state.target, e), state.pointerType); | ||
} | ||
} else if (state.target && state.isOverTarget && state.pointerType != null) { | ||
pressProps.onPointerLeave = (e) => { | ||
if (e.pointerId === state.activePointerId && state.target && state.isOverTarget && state.pointerType != null) { | ||
state.isOverTarget = false; | ||
@@ -502,3 +501,3 @@ triggerPressEnd(createEvent(state.target, e), state.pointerType, false); | ||
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) { | ||
if (isOverTarget(e, state.target) && state.pointerType != null) { | ||
if (state.target.contains(e.target as Element) && state.pointerType != null) { | ||
triggerPressEnd(createEvent(state.target, e), state.pointerType); | ||
@@ -794,3 +793,3 @@ } else if (state.isOverTarget && state.pointerType != null) { | ||
// Remove user-select: none in case component unmounts immediately after pressStart | ||
useEffect(() => { | ||
@@ -797,0 +796,0 @@ return () => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
712674
8414
+ Added@react-aria/ssr@3.0.0-nightly-326f48154-241212(transitive)
+ Added@react-aria/utils@3.0.0-nightly-326f48154-241212(transitive)
+ Added@react-stately/utils@3.0.0-nightly-326f48154-241212(transitive)
+ Added@react-types/shared@3.0.0-nightly-326f48154-241212(transitive)
- Removed@react-aria/ssr@3.9.7(transitive)
- Removed@react-aria/utils@3.26.0(transitive)
- Removed@react-stately/utils@3.10.5(transitive)
- Removed@react-types/shared@3.26.0(transitive)