@asymmetric-effort/specifyjs 0.2.155 → 0.2.156
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.
|
@@ -17779,7 +17779,8 @@ function Board(props) {
|
|
|
17779
17779
|
pos = snapToGrid(position, GRID_SIZE);
|
|
17780
17780
|
}
|
|
17781
17781
|
dispatch({ type: "MOVE_ITEM", itemId, position: pos });
|
|
17782
|
-
|
|
17782
|
+
const currentDragging = draggingCardIdRef.current;
|
|
17783
|
+
if (currentDragging === itemId) {
|
|
17783
17784
|
let cardWidth = 0;
|
|
17784
17785
|
let cardHeight = 0;
|
|
17785
17786
|
const searchStack = [...collection];
|
|
@@ -17799,7 +17800,7 @@ function Board(props) {
|
|
|
17799
17800
|
const containerId = findContainerAtPoint(collection, centerX, centerY, itemId);
|
|
17800
17801
|
setDropTargetId(containerId);
|
|
17801
17802
|
}
|
|
17802
|
-
}, [dispatch, gridEnabled,
|
|
17803
|
+
}, [dispatch, gridEnabled, collection]);
|
|
17803
17804
|
const handleResizeItem = useCallback((itemId, size) => {
|
|
17804
17805
|
dispatch({ type: "RESIZE_ITEM", itemId, size });
|
|
17805
17806
|
}, [dispatch]);
|
|
@@ -17812,8 +17813,11 @@ function Board(props) {
|
|
|
17812
17813
|
}, [dispatch]);
|
|
17813
17814
|
const handleCardDragStart = useCallback((cardId) => {
|
|
17814
17815
|
setDraggingCardId(cardId);
|
|
17816
|
+
draggingCardIdRef.current = cardId;
|
|
17815
17817
|
setDropTargetId(null);
|
|
17816
17818
|
}, []);
|
|
17819
|
+
const draggingCardIdRef = useRef(null);
|
|
17820
|
+
draggingCardIdRef.current = draggingCardId;
|
|
17817
17821
|
const dropTargetIdRef = useRef(null);
|
|
17818
17822
|
dropTargetIdRef.current = dropTargetId;
|
|
17819
17823
|
const handleCardDragEnd = useCallback((cardId) => {
|
|
@@ -17822,6 +17826,7 @@ function Board(props) {
|
|
|
17822
17826
|
dispatch({ type: "NEST_ITEM", itemId: cardId, containerId: target });
|
|
17823
17827
|
}
|
|
17824
17828
|
setDraggingCardId(null);
|
|
17829
|
+
draggingCardIdRef.current = null;
|
|
17825
17830
|
setDropTargetId(null);
|
|
17826
17831
|
}, [dispatch]);
|
|
17827
17832
|
const handleAnchorDragStart = useCallback((cardId, anchor, pos) => {
|