Skip to content

Commit e820196

Browse files
authored
Merge pull request #126 from knom/feature/gallery-improvements
If one element is already selected - make it easier to select more
2 parents 37aed00 + 86306bb commit e820196

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/assets/missing-location/MissingLocationAssets.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,15 @@ export default function MissingLocationAssets({ groupBy }: IProps) {
8181
[images]
8282
);
8383

84-
const handleClick = (idx: number) => setIndex(idx);
84+
const handleClick = (idx: number, asset: IAsset, event: MouseEvent<HTMLElement>) => {
85+
if (selectedIds.length > 0) {
86+
handleSelect(idx, asset, event);
87+
}
88+
else
89+
{
90+
setIndex(idx);
91+
}
92+
};
8593

8694
const handleSelect = (_idx: number, asset: IAsset, event: MouseEvent<HTMLElement>) => {
8795
event.stopPropagation();

0 commit comments

Comments
 (0)