Skip to content

Commit e68ce34

Browse files
author
Attila Cseh
committed
respect direction of selection in Gallery
1 parent 47d7d93 commit e68ce34

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ const buildOnClick =
118118
const start = Math.min(lastClickedIndex, currentClickedIndex);
119119
const end = Math.max(lastClickedIndex, currentClickedIndex);
120120
const imagesToSelect = imageNames.slice(start, end + 1);
121-
dispatch(selectionChanged(uniq(selection.concat(imagesToSelect))));
121+
if(currentClickedIndex < lastClickedIndex) {
122+
imagesToSelect.reverse();
123+
}
124+
dispatch(selectionChanged(imagesToSelect));
122125
}
123126
} else if (ctrlKey || metaKey) {
124127
if (selection.some((n) => n === imageName) && selection.length > 1) {

0 commit comments

Comments
 (0)