@micromag/core 0.3.196 → 0.3.202

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 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 && !dragging) {
303
+ if (wantedProgress !== progress && !refDragging.current) {
301
304
  setDragState({
302
- dragging: 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 && !dragging) {
341
+ if (wantedProgress !== progress && !refDragging.current) {
339
342
  setDragState({
340
- dragging: 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.196",
3
+ "version": "0.3.202",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -133,5 +133,5 @@
133
133
  "publishConfig": {
134
134
  "access": "public"
135
135
  },
136
- "gitHead": "f76253e63fa17840ffa08757a7f4a32554868288"
136
+ "gitHead": "2bde6156abc5306b3303a3c860f81e2446696e79"
137
137
  }