fix: app sidebar project list dnd disabled when sidebar is collapsed (#4623)

This commit is contained in:
Anmol Singh Bhatia 2024-05-28 16:49:39 +05:30 committed by GitHub
parent c87749cbda
commit 5efa8264d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -186,7 +186,7 @@ export const ProjectSidebarListItem: React.FC<Props> = observer((props) => {
return combine( return combine(
draggable({ draggable({
element, element,
canDrag: () => !disableDrag, canDrag: () => !disableDrag && !isCollapsed,
dragHandle: dragHandleElement ?? undefined, dragHandle: dragHandleElement ?? undefined,
getInitialData: () => ({ id: projectId, dragInstanceId: "PROJECTS" }), getInitialData: () => ({ id: projectId, dragInstanceId: "PROJECTS" }),
onDragStart: () => { onDragStart: () => {
@ -306,6 +306,7 @@ export const ProjectSidebarListItem: React.FC<Props> = observer((props) => {
"group-hover:opacity-100": !isCollapsed, "group-hover:opacity-100": !isCollapsed,
"cursor-not-allowed opacity-60": project.sort_order === null, "cursor-not-allowed opacity-60": project.sort_order === null,
flex: isMenuActive, flex: isMenuActive,
hidden: isCollapsed,
} }
)} )}
ref={dragHandleRef} ref={dragHandleRef}