When the root folder is selected, ignore the selected items when dragging (#15392)

GitOrigin-RevId: a43e4f668d2df8c9abe5d67bd42546eaa5496c59
This commit is contained in:
Alf Eaton 2023-10-25 10:25:13 +01:00 committed by Copybot
parent 949d4facc7
commit 2678600108

View file

@ -83,7 +83,7 @@ export function useDraggable(draggedEntityId) {
const { permissionsLevel } = useEditorContext(editorContextPropTypes)
const { fileTreeData } = useFileTreeData()
const { selectedEntityIds } = useFileTreeSelectable()
const { selectedEntityIds, isRootFolderSelected } = useFileTreeSelectable()
const [isDraggable, setIsDraggable] = useState(true)
@ -92,7 +92,7 @@ export function useDraggable(draggedEntityId) {
item, // required, but overwritten by the return value of `begin`
begin: () => {
const draggedEntityIds = getDraggedEntityIds(
selectedEntityIds,
isRootFolderSelected ? new Set() : selectedEntityIds,
draggedEntityId
)
const draggedItems = findAllInTreeOrThrow(fileTreeData, draggedEntityIds)