@canlooks/can-ui 0.0.137 → 0.0.138
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.
|
@@ -93,6 +93,7 @@ function useGesture(options) {
|
|
|
93
93
|
}
|
|
94
94
|
const { clickVibration } = syncOptions.current;
|
|
95
95
|
if (!isDragged.current && (absDiffX > clickVibration || absDiffY > clickVibration)) {
|
|
96
|
+
// 拖拽距离超过允许抖动,将isDragged标记为true
|
|
96
97
|
isDragged.current = true;
|
|
97
98
|
}
|
|
98
99
|
syncOptions.current.onDrag?.(dragInfo, e);
|
|
@@ -100,7 +101,6 @@ function useGesture(options) {
|
|
|
100
101
|
const cancelDragFn = () => {
|
|
101
102
|
delayTimeout.current && clearTimeout(delayTimeout.current);
|
|
102
103
|
delayTimeout.current = void 0;
|
|
103
|
-
isDragged.current = false;
|
|
104
104
|
document.documentElement.style.userSelect = '';
|
|
105
105
|
removeEventListener('pointermove', draggingPointerMove);
|
|
106
106
|
removeEventListener('pointerup', draggingPointerUp);
|
|
@@ -88,6 +88,7 @@ export function useGesture(options) {
|
|
|
88
88
|
}
|
|
89
89
|
const { clickVibration } = syncOptions.current;
|
|
90
90
|
if (!isDragged.current && (absDiffX > clickVibration || absDiffY > clickVibration)) {
|
|
91
|
+
// 拖拽距离超过允许抖动,将isDragged标记为true
|
|
91
92
|
isDragged.current = true;
|
|
92
93
|
}
|
|
93
94
|
syncOptions.current.onDrag?.(dragInfo, e);
|
|
@@ -95,7 +96,6 @@ export function useGesture(options) {
|
|
|
95
96
|
const cancelDragFn = () => {
|
|
96
97
|
delayTimeout.current && clearTimeout(delayTimeout.current);
|
|
97
98
|
delayTimeout.current = void 0;
|
|
98
|
-
isDragged.current = false;
|
|
99
99
|
document.documentElement.style.userSelect = '';
|
|
100
100
|
removeEventListener('pointermove', draggingPointerMove);
|
|
101
101
|
removeEventListener('pointerup', draggingPointerUp);
|