respect direction of selection in Gallery

This commit is contained in:
Attila Cseh
2025-08-22 13:41:29 +02:00
committed by psychedelicious
parent 2496ac19c4
commit ee6a2a6603

View File

@@ -118,7 +118,10 @@ const buildOnClick =
const start = Math.min(lastClickedIndex, currentClickedIndex);
const end = Math.max(lastClickedIndex, currentClickedIndex);
const imagesToSelect = imageNames.slice(start, end + 1);
dispatch(selectionChanged(uniq(selection.concat(imagesToSelect))));
if(currentClickedIndex < lastClickedIndex) {
imagesToSelect.reverse();
}
dispatch(selectionChanged(imagesToSelect));
}
} else if (ctrlKey || metaKey) {
if (selection.some((n) => n === imageName) && selection.length > 1) {