fix
This commit is contained in:
@@ -158,24 +158,22 @@ const useDocumentDrag = () => {
|
||||
: [];
|
||||
|
||||
if (stackDocIdsOption && stackDocIdsOption.length) {
|
||||
selectionIds = stackDocIdsOption;
|
||||
const selectionSet = new Set(selectionIds);
|
||||
stackDocIdsOption.forEach((value) => {
|
||||
if (value != null) {
|
||||
selectionSet.add(String(value));
|
||||
}
|
||||
});
|
||||
selectionIds = Array.from(selectionSet);
|
||||
}
|
||||
|
||||
const metaOrCtrl = event.metaKey || event.ctrlKey;
|
||||
if (!stackDocIdsOption && metaOrCtrl && !selectionIds.includes(docKey)) {
|
||||
selectionIds = [...selectionIds, docKey];
|
||||
}
|
||||
let groupDocIds = [];
|
||||
if (stackDocIdsOption && stackDocIdsOption.length) {
|
||||
groupDocIds = stackDocIdsOption.filter((id, index, array) => {
|
||||
const unique = array.indexOf(id) === index;
|
||||
return unique && documentLookup.has(id);
|
||||
});
|
||||
} else if (selectionIds.includes(docKey) && selectionIds.length > 1) {
|
||||
groupDocIds = selectionIds
|
||||
.map((id) => String(id))
|
||||
.filter((id, index, array) => array.indexOf(id) === index && documentLookup.has(id));
|
||||
}
|
||||
let groupDocIds = selectionIds
|
||||
.map((id) => String(id))
|
||||
.filter((id, index, array) => array.indexOf(id) === index && documentLookup.has(id));
|
||||
if (!groupDocIds.includes(docKey)) {
|
||||
groupDocIds.unshift(docKey);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user