fix: 트리 메뉴 순서 변경 dnd 로직 수정
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user