@micromag/core 0.3.194 → 0.3.203
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/es/hooks.js +5 -2
- package/lib/hooks.js +5 -2
- package/package.json +2 -2
package/es/hooks.js
CHANGED
|
@@ -254,6 +254,8 @@ function useDragProgress() {
|
|
|
254
254
|
_ref$springParams = _ref.springParams,
|
|
255
255
|
springParams = _ref$springParams === void 0 ? undefined : _ref$springParams;
|
|
256
256
|
|
|
257
|
+
var refDragging = useRef(false);
|
|
258
|
+
|
|
257
259
|
var _useState = useState({
|
|
258
260
|
dragging: false,
|
|
259
261
|
progress: wantedProgress
|
|
@@ -282,6 +284,7 @@ function useDragProgress() {
|
|
|
282
284
|
}
|
|
283
285
|
|
|
284
286
|
var newProgress = computeProgress(gestureState);
|
|
287
|
+
refDragging.current = active;
|
|
285
288
|
setDragState({
|
|
286
289
|
dragging: active,
|
|
287
290
|
progress: newProgress
|
|
@@ -297,9 +300,9 @@ function useDragProgress() {
|
|
|
297
300
|
});
|
|
298
301
|
var springedProgress = useSpringValue(progress, dragging || disabled, springParams);
|
|
299
302
|
useEffect(function () {
|
|
300
|
-
if (wantedProgress !== progress && !
|
|
303
|
+
if (wantedProgress !== progress && !refDragging.current) {
|
|
301
304
|
setDragState({
|
|
302
|
-
dragging:
|
|
305
|
+
dragging: refDragging.current,
|
|
303
306
|
progress: wantedProgress
|
|
304
307
|
});
|
|
305
308
|
}
|
package/lib/hooks.js
CHANGED
|
@@ -292,6 +292,8 @@ function useDragProgress() {
|
|
|
292
292
|
_ref$springParams = _ref.springParams,
|
|
293
293
|
springParams = _ref$springParams === void 0 ? undefined : _ref$springParams;
|
|
294
294
|
|
|
295
|
+
var refDragging = react.useRef(false);
|
|
296
|
+
|
|
295
297
|
var _useState = react.useState({
|
|
296
298
|
dragging: false,
|
|
297
299
|
progress: wantedProgress
|
|
@@ -320,6 +322,7 @@ function useDragProgress() {
|
|
|
320
322
|
}
|
|
321
323
|
|
|
322
324
|
var newProgress = computeProgress(gestureState);
|
|
325
|
+
refDragging.current = active;
|
|
323
326
|
setDragState({
|
|
324
327
|
dragging: active,
|
|
325
328
|
progress: newProgress
|
|
@@ -335,9 +338,9 @@ function useDragProgress() {
|
|
|
335
338
|
});
|
|
336
339
|
var springedProgress = useSpringValue(progress, dragging || disabled, springParams);
|
|
337
340
|
react.useEffect(function () {
|
|
338
|
-
if (wantedProgress !== progress && !
|
|
341
|
+
if (wantedProgress !== progress && !refDragging.current) {
|
|
339
342
|
setDragState({
|
|
340
|
-
dragging:
|
|
343
|
+
dragging: refDragging.current,
|
|
341
344
|
progress: wantedProgress
|
|
342
345
|
});
|
|
343
346
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.203",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"publishConfig": {
|
|
134
134
|
"access": "public"
|
|
135
135
|
},
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "b297ceba08e2590bf75836ede1154bef06829ee5"
|
|
137
137
|
}
|