mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 13:03:42 -05:00
When the root folder is selected, ignore the selected items when dragging (#15392)
GitOrigin-RevId: a43e4f668d2df8c9abe5d67bd42546eaa5496c59
This commit is contained in:
parent
949d4facc7
commit
2678600108
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue