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;
if (!state.groupElevated) {
state.groupDocIds.forEach((id) => {
if (id === state.docKey) {
bringToFront(state.docId);
} else {
bringToFront(id);
}
const layout = layoutRef.current;
const sortedGroup = state.groupDocIds
.filter((id) => id !== state.docKey)
.sort((a, b) => {
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;
}
}