fix(web): multi-select (#18485)

This commit is contained in:
Daimolean 2025-05-23 04:17:34 +08:00 committed by GitHub
parent 065f7c7d5d
commit c7dc31151d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -564,12 +564,9 @@
return; return;
} }
// Select/deselect assets in range (start,end] // Select/deselect assets in range (start,end)
let started = false; let started = false;
for (const bucket of assetStore.buckets) { for (const bucket of assetStore.buckets) {
if (bucket === startBucket) {
started = true;
}
if (bucket === endBucket) { if (bucket === endBucket) {
break; break;
} }
@ -583,18 +580,18 @@
} }
} }
} }
if (bucket === startBucket) {
started = true;
}
} }
// Update date group selection // Update date group selection in range [start,end]
started = false; started = false;
for (const bucket of assetStore.buckets) { for (const bucket of assetStore.buckets) {
if (bucket === startBucket) { if (bucket === startBucket) {
started = true; started = true;
} }
if (bucket === endBucket) { if (started) {
break;
}
// Split bucket into date groups and check each group // Split bucket into date groups and check each group
for (const dateGroup of bucket.dateGroups) { for (const dateGroup of bucket.dateGroups) {
const dateGroupTitle = dateGroup.groupTitle; const dateGroupTitle = dateGroup.groupTitle;
@ -605,6 +602,10 @@
} }
} }
} }
if (bucket === endBucket) {
break;
}
}
} }
assetInteraction.setAssetSelectionStart(deselect ? null : asset); assetInteraction.setAssetSelectionStart(deselect ? null : asset);