This commit is contained in:
2025-11-04 14:18:41 +01:00
parent dd378b3ad8
commit 82b33a4d50
4 changed files with 100 additions and 35 deletions
+4 -2
View File
@@ -154,6 +154,7 @@ const useDocumentDrag = () => {
const pointerModifierActive = typeof options?.modifierActive === 'boolean'
? options.modifierActive
: Boolean(event.metaKey || event.ctrlKey || event.shiftKey || event.altKey);
const stackReplace = Boolean(options?.stackReplace);
let selectionIds = Array.isArray(selectedDocumentIds)
? selectedDocumentIds.map((id) => String(id))
@@ -330,6 +331,7 @@ const useDocumentDrag = () => {
groupElevated: !isGroupDrag,
stackDocIds: hasStackSource ? stackDocIdsOption : null,
stackSelectionApplied: stackSelectionAppliedInitial || !hasStackSource,
stackReplace,
};
setDraggingId(docId);
@@ -412,10 +414,10 @@ const useDocumentDrag = () => {
state.isGroup
&& !state.stackSelectionApplied
&& Array.isArray(state.stackDocIds)
&& state.stackDocIds.length > 1
&& state.stackDocIds.length > 0
) {
if (typeof onDocumentStackSelect === 'function') {
onDocumentStackSelect(state.stackDocIds);
onDocumentStackSelect(state.stackDocIds, event, { replace: state.stackReplace });
}
state.stackSelectionApplied = true;
}