@react-aria/interactions
Advanced tools
Comparing version 3.0.0-nightly.741 to 3.0.0-nightly.746
@@ -1439,2 +1439,3 @@ var _react2 = require("react"); | ||
end('touch'); | ||
state.current.id = null; | ||
removeGlobalListener(window, 'touchmove', onTouchMove); | ||
@@ -1447,3 +1448,3 @@ removeGlobalListener(window, 'touchend', onTouchEnd); | ||
moveProps.onTouchStart = e => { | ||
if (e.targetTouches.length === 0) { | ||
if (e.changedTouches.length === 0 || state.current.id != null) { | ||
return; | ||
@@ -1456,3 +1457,3 @@ } | ||
identifier | ||
} = e.targetTouches[0]; | ||
} = e.changedTouches[0]; | ||
start(); | ||
@@ -1491,2 +1492,3 @@ e.stopPropagation(); | ||
end(pointerType); | ||
state.current.id = null; | ||
removeGlobalListener(window, 'pointermove', onPointerMove, false); | ||
@@ -1499,3 +1501,3 @@ removeGlobalListener(window, 'pointerup', onPointerUp, false); | ||
moveProps.onPointerDown = e => { | ||
if (e.button === 0) { | ||
if (e.button === 0 && state.current.id == null) { | ||
start(); | ||
@@ -1555,3 +1557,3 @@ e.stopPropagation(); | ||
return moveProps; | ||
}, [state, onMoveStart, onMove, onMoveEnd]); | ||
}, [state, onMoveStart, onMove, onMoveEnd, addGlobalListener, removeGlobalListener]); | ||
return moveProps; | ||
@@ -1558,0 +1560,0 @@ } |
@@ -1383,2 +1383,3 @@ import _react, { useContext, useEffect, useMemo, useRef, useState } from "react"; | ||
end('touch'); | ||
state.current.id = null; | ||
removeGlobalListener(window, 'touchmove', onTouchMove); | ||
@@ -1391,3 +1392,3 @@ removeGlobalListener(window, 'touchend', onTouchEnd); | ||
moveProps.onTouchStart = e => { | ||
if (e.targetTouches.length === 0) { | ||
if (e.changedTouches.length === 0 || state.current.id != null) { | ||
return; | ||
@@ -1400,3 +1401,3 @@ } | ||
identifier | ||
} = e.targetTouches[0]; | ||
} = e.changedTouches[0]; | ||
start(); | ||
@@ -1435,2 +1436,3 @@ e.stopPropagation(); | ||
end(pointerType); | ||
state.current.id = null; | ||
removeGlobalListener(window, 'pointermove', onPointerMove, false); | ||
@@ -1443,3 +1445,3 @@ removeGlobalListener(window, 'pointerup', onPointerUp, false); | ||
moveProps.onPointerDown = e => { | ||
if (e.button === 0) { | ||
if (e.button === 0 && state.current.id == null) { | ||
start(); | ||
@@ -1499,5 +1501,5 @@ e.stopPropagation(); | ||
return moveProps; | ||
}, [state, onMoveStart, onMove, onMoveEnd]); | ||
}, [state, onMoveStart, onMove, onMoveEnd, addGlobalListener, removeGlobalListener]); | ||
return moveProps; | ||
} | ||
//# sourceMappingURL=module.js.map |
{ | ||
"name": "@react-aria/interactions", | ||
"version": "3.0.0-nightly.741+975957a3", | ||
"version": "3.0.0-nightly.746+db9b0228", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,4 +21,4 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/utils": "3.0.0-nightly.741+975957a3", | ||
"@react-types/shared": "3.0.0-nightly.741+975957a3" | ||
"@react-aria/utils": "3.0.0-nightly.746+db9b0228", | ||
"@react-types/shared": "3.0.0-nightly.746+db9b0228" | ||
}, | ||
@@ -31,3 +31,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "975957a3c3fb4a9f3be358428e0980a4d4e51c1a" | ||
"gitHead": "db9b022848d4b83627aa98a0b347534bf3376ed4" | ||
} |
@@ -125,2 +125,3 @@ /* | ||
end('touch'); | ||
state.current.id = null; | ||
removeGlobalListener(window, 'touchmove', onTouchMove); | ||
@@ -132,7 +133,7 @@ removeGlobalListener(window, 'touchend', onTouchEnd); | ||
moveProps.onTouchStart = (e: React.TouchEvent) => { | ||
if (e.targetTouches.length === 0) { | ||
if (e.changedTouches.length === 0 || state.current.id != null) { | ||
return; | ||
} | ||
let {pageX, pageY, identifier} = e.targetTouches[0]; | ||
let {pageX, pageY, identifier} = e.changedTouches[0]; | ||
start(); | ||
@@ -166,2 +167,3 @@ e.stopPropagation(); | ||
end(pointerType); | ||
state.current.id = null; | ||
removeGlobalListener(window, 'pointermove', onPointerMove, false); | ||
@@ -174,3 +176,3 @@ removeGlobalListener(window, 'pointerup', onPointerUp, false); | ||
moveProps.onPointerDown = (e: React.PointerEvent) => { | ||
if (e.button === 0) { | ||
if (e.button === 0 && state.current.id == null) { | ||
start(); | ||
@@ -224,5 +226,5 @@ e.stopPropagation(); | ||
return moveProps; | ||
}, [state, onMoveStart, onMove, onMoveEnd]); | ||
}, [state, onMoveStart, onMove, onMoveEnd, addGlobalListener, removeGlobalListener]); | ||
return moveProps; | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
393901
4369