mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-28 15:27:49 +01:00
fix photo selection on macos
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import "./Overview.scss";
|
import "./Overview.scss";
|
||||||
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Dispatch } from "redux";
|
import { Dispatch } from "redux";
|
||||||
@@ -54,7 +55,7 @@ export const OverviewComponent: React.FunctionComponent<
|
|||||||
const selectedPhotosRef = React.useRef<Set<number>>(selectedPhotos);
|
const selectedPhotosRef = React.useRef<Set<number>>(selectedPhotos);
|
||||||
selectedPhotosRef.current = selectedPhotos;
|
selectedPhotosRef.current = selectedPhotos;
|
||||||
const onCardClick = (e: React.MouseEvent<HTMLElement>, id: number) => {
|
const onCardClick = (e: React.MouseEvent<HTMLElement>, id: number) => {
|
||||||
if (e.ctrlKey) {
|
if (e.ctrlKey || e.metaKey) {
|
||||||
const newSelectedPhotos = new Set<number>([
|
const newSelectedPhotos = new Set<number>([
|
||||||
...selectedPhotosRef.current,
|
...selectedPhotosRef.current,
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user