From 6aaacf419feaed9bf918159bb510add9e2c27156 Mon Sep 17 00:00:00 2001 From: BrianHung Date: Thu, 6 Jan 2022 17:35:36 -0800 Subject: [PATCH 1/3] fix: `grid` prop unused in `handleDragStop` --- lib/DraggableCore.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/DraggableCore.js b/lib/DraggableCore.js index c5a3da8f..f77aa81f 100644 --- a/lib/DraggableCore.js +++ b/lib/DraggableCore.js @@ -384,6 +384,15 @@ export default class DraggableCore extends React.Component Date: Thu, 6 Jan 2022 17:38:24 -0800 Subject: [PATCH 2/3] call `onStop` even if `deltaX = 0` and `deltaY = 0` --- lib/DraggableCore.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/DraggableCore.js b/lib/DraggableCore.js index f77aa81f..32e9d14f 100644 --- a/lib/DraggableCore.js +++ b/lib/DraggableCore.js @@ -389,7 +389,6 @@ export default class DraggableCore extends React.Component Date: Thu, 27 Jan 2022 00:51:30 -0800 Subject: [PATCH 3/3] fix `const {x, y}` in `handleDragStop`; add test case for `grid` prop --- lib/DraggableCore.js | 2 +- specs/draggable.spec.jsx | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/DraggableCore.js b/lib/DraggableCore.js index 32e9d14f..a53b7de8 100644 --- a/lib/DraggableCore.js +++ b/lib/DraggableCore.js @@ -383,7 +383,7 @@ export default class DraggableCore extends React.Component +
+ + ); + + // (element, fromX, fromY, toX, toY) + simulateMovementFromTo(drag, 0, 0, 100, 100); + }); });