svelte-gestures
Advanced tools
Comparing version 1.3.0 to 1.3.1
# Changelog | ||
## 1.3.1 | ||
Removing move listener when user leave active element. | ||
When the move capture on active element is lost, `activeEvents` are set to [] and `up` event is triggered. | ||
## 1.3.0 | ||
@@ -4,0 +9,0 @@ |
@@ -57,5 +57,3 @@ const DEFAULT_DELAY = 300; | ||
if (!activeEvents.length) { | ||
removePointermoveHandler(); | ||
removeLostpointercaptureHandler(); | ||
removepointerupHandler(); | ||
removeEventHandlers(); | ||
} | ||
@@ -68,2 +66,9 @@ | ||
function removeEventHandlers() { | ||
removePointermoveHandler(); | ||
removeLostpointercaptureHandler(); | ||
removepointerupHandler(); | ||
removepointerleaveHandler(); | ||
} | ||
const removePointermoveHandler = addEventListener(node, 'pointermove', e => { | ||
@@ -82,2 +87,8 @@ activeEvents = activeEvents.map(activeEvent => { | ||
}); | ||
const removepointerleaveHandler = addEventListener(node, 'pointerleave', e => { | ||
activeEvents = []; | ||
removeEventHandlers(); | ||
dispatch(node, gestureName, e, activeEvents, 'up'); | ||
onUpCallback?.(activeEvents, e); | ||
}); | ||
} | ||
@@ -84,0 +95,0 @@ |
@@ -61,5 +61,3 @@ 'use strict'; | ||
if (!activeEvents.length) { | ||
removePointermoveHandler(); | ||
removeLostpointercaptureHandler(); | ||
removepointerupHandler(); | ||
removeEventHandlers(); | ||
} | ||
@@ -72,2 +70,9 @@ | ||
function removeEventHandlers() { | ||
removePointermoveHandler(); | ||
removeLostpointercaptureHandler(); | ||
removepointerupHandler(); | ||
removepointerleaveHandler(); | ||
} | ||
const removePointermoveHandler = addEventListener(node, 'pointermove', e => { | ||
@@ -86,2 +91,8 @@ activeEvents = activeEvents.map(activeEvent => { | ||
}); | ||
const removepointerleaveHandler = addEventListener(node, 'pointerleave', e => { | ||
activeEvents = []; | ||
removeEventHandlers(); | ||
dispatch(node, gestureName, e, activeEvents, 'up'); | ||
onUpCallback?.(activeEvents, e); | ||
}); | ||
} | ||
@@ -88,0 +99,0 @@ |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"main": "dist/index.js", | ||
@@ -9,0 +9,0 @@ "module": "dist/index.esm.js", |
@@ -5,4 +5,8 @@ # svelte-gestures | ||
It contains the most popular gestures: `pan`, `pinch`, `rotate`, `swipe`, `tap`. It also exposes generic event handling core, which can be extended for your own specific gesture implementation (see sourcecode how gestures are implemented). | ||
## installation | ||
`npm install svelte-gestures` | ||
It contains the most popular gestures: `pan`, `pinch`, `press`, `rotate`, `swipe`, `tap`. It also exposes generic event handling core, which can be extended for your own specific gesture implementation (see sourcecode how gestures are implemented). | ||
It uses pointer events under the hood, to make it really cross platform. Gestures will be recognized, if done by mouse, touche, stylus etc. | ||
@@ -9,0 +13,0 @@ |
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
38539
694
300