From b23e90c673e983f0385940e4225a2b06106e807f Mon Sep 17 00:00:00 2001 From: KaWaite Date: Mon, 27 Sep 2021 18:27:08 +0900 Subject: [PATCH] 1.1.5 - avoid onMoveArea if same location --- package.json | 4 ++-- src/Grid/GridItem/index.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index da1f0e1..288dcab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-align", - "version": "1.1.4", + "version": "1.1.5", "author": "KaWaite", "module": "dist/realign.esm.js", "license": "MIT", @@ -77,4 +77,4 @@ "react-dnd": "^14.0.2", "react-dnd-html5-backend": "^14.0.0" } -} +} \ No newline at end of file diff --git a/src/Grid/GridItem/index.tsx b/src/Grid/GridItem/index.tsx index 23fdd72..8c1d4e2 100644 --- a/src/Grid/GridItem/index.tsx +++ b/src/Grid/GridItem/index.tsx @@ -145,7 +145,7 @@ export default function GridItem({ location: T; } | null = monitor.getDropResult(); - if (dropResults) { + if (dropResults && dropResults.location !== location) { onMoveArea(item.id, dropResults.location, location); } },