This commit is contained in:
2025-11-02 15:20:41 +01:00
parent d6a6d1233c
commit 4f296ac1e3
+13 -6
View File
@@ -522,13 +522,20 @@ const useDocumentDrag = () => {
} }
state.moved = true; state.moved = true;
if (!state.groupElevated) { if (!state.groupElevated) {
state.groupDocIds.forEach((id) => { const layout = layoutRef.current;
if (id === state.docKey) { const sortedGroup = state.groupDocIds
bringToFront(state.docId); .filter((id) => id !== state.docKey)
} else { .sort((a, b) => {
bringToFront(id); const aZ = layout.get(a)?.z ?? 0;
} const bZ = layout.get(b)?.z ?? 0;
return aZ - bZ;
}); });
sortedGroup.forEach((id) => {
bringToFront(id);
});
bringToFront(state.docId);
state.groupElevated = true; state.groupElevated = true;
} }
} }