fix: 트리 메뉴 순서 변경 dnd 로직 수정

This commit is contained in:
2025-03-26 10:09:38 +09:00
parent 403bbe3647
commit f94b8a3f8e
2 changed files with 2 additions and 4 deletions
+1 -3
View File
@@ -29,9 +29,7 @@ export const generateNewTreeData = (
if (!dragSource?.data) return null;
const siblings = treeData.filter(
(node) => node.parent === dragSource?.parent,
);
const siblings = treeData.filter((node) => node.parent === dropTargetId);
const newSortSeq =
siblings.findIndex((sibling) => sibling.id === dragSourceId) + 1;
+1 -1
View File
@@ -60,7 +60,7 @@ function MenuTree({ treeData, siteId }: MenuTreeProps) {
placeholder: "relative",
}}
sort={false}
dropTargetOffset={10}
dropTargetOffset={5}
insertDroppableFirst={false}
canDrop={(_, { dragSource, dropTargetId }) => {
if (dragSource?.parent === dropTargetId) {