mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 09:48:28 +02:00
Fix sidebar folder dragging collapse
https://feedback.yaak.app/p/a-folder-may-hide-its-content-if-i-move-a
This commit is contained in:
@@ -232,6 +232,7 @@ export function Sidebar({ className }: Props) {
|
||||
const handleEnd = useCallback<SidebarItemProps['onEnd']>(
|
||||
async (itemId) => {
|
||||
setHoveredTree(null);
|
||||
setDraggingId(null);
|
||||
handleClearSelected();
|
||||
|
||||
if (hoveredTree == null || hoveredIndex == null) {
|
||||
@@ -278,9 +279,8 @@ export function Sidebar({ className }: Props) {
|
||||
);
|
||||
} else {
|
||||
const sortPriority = afterPriority - (afterPriority - beforePriority) / 2;
|
||||
return patchModelById(child.model, child.id, { sortPriority, folderId });
|
||||
await patchModelById(child.model, child.id, { sortPriority, folderId });
|
||||
}
|
||||
setDraggingId(null);
|
||||
},
|
||||
[handleClearSelected, hoveredTree, hoveredIndex, treeParentMap],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user