fix: Clickable area for docs in sidebar is obstructed (#2809)

closes #2808
This commit is contained in:
Tom Moor
2021-12-03 06:44:06 -08:00
committed by GitHub
parent d8d3e2bef2
commit 82bc6ef45b
3 changed files with 29 additions and 33 deletions

View File

@@ -197,7 +197,7 @@ function DocumentLink(
});
// Drop to reorder
const [{ isOverReorder }, dropToReorder] = useDrop({
const [{ isOverReorder, isDraggingAnyDocument }, dropToReorder] = useDrop({
accept: "document",
drop: (item: DragObject) => {
if (!collection) return;
@@ -212,6 +212,7 @@ function DocumentLink(
},
collect: (monitor) => ({
isOverReorder: !!monitor.isOver(),
isDraggingAnyDocument: !!monitor.canDrop(),
}),
});
@@ -274,7 +275,7 @@ function DocumentLink(
</DropToImport>
</div>
</Draggable>
{manualSort && (
{manualSort && isDraggingAnyDocument && (
<DropCursor isActiveDrop={isOverReorder} innerRef={dropToReorder} />
)}
</Relative>