diff --git a/libs/remix-ui/workspace/src/lib/components/flat-tree-drop.tsx b/libs/remix-ui/workspace/src/lib/components/flat-tree-drop.tsx index 26ace2dce1..652b1e43f8 100644 --- a/libs/remix-ui/workspace/src/lib/components/flat-tree-drop.tsx +++ b/libs/remix-ui/workspace/src/lib/components/flat-tree-drop.tsx @@ -58,10 +58,7 @@ export const FlatTreeDrop = (props: FlatTreeDropProps) => { const target = await getEventTarget(event) const items = buildMultiSelectedItemProfiles(target) const filePaths = [] - filePaths.push(target && target.path ? target.path : '/') - items.forEach((item) => filePaths.push(item.path)) - props.setFilesSelected(filePaths) - console.log('onDrop', { items, target, filePaths }) + // console.log('onDrop', { items, target, filePaths }) let dragDestination: any if (!target || !target.path) { dragDestination = { @@ -71,6 +68,11 @@ export const FlatTreeDrop = (props: FlatTreeDropProps) => { } else { dragDestination = getFlatTreeItem(target.path) } + + filePaths.push(dragDestination.path) + items.forEach((item) => filePaths.push(item.path)) + props.setFilesSelected(filePaths) + if (dragDestination.isDirectory) { if (dragSource.isDirectory) { moveFolder(dragDestination.path, [dragSource.path])