mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-18 09:04:28 +03:00
ensure meta click works on desktop safari to select objects in explore
This commit is contained in:
parent
6d8234fa27
commit
f90a334b48
@ -1,4 +1,4 @@
|
|||||||
import { useMemo } from "react";
|
import { useCallback, useMemo } from "react";
|
||||||
import { useApiHost } from "@/api";
|
import { useApiHost } from "@/api";
|
||||||
import { getIconForLabel } from "@/utils/iconUtil";
|
import { getIconForLabel } from "@/utils/iconUtil";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
@ -33,6 +33,16 @@ export default function SearchThumbnail({
|
|||||||
onClick(searchResult, true, false);
|
onClick(searchResult, true, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const handleOnClick = useCallback(
|
||||||
|
(e: React.MouseEvent<HTMLDivElement>) => {
|
||||||
|
if (e.metaKey) {
|
||||||
|
e.stopPropagation();
|
||||||
|
onClick(searchResult, true, false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[searchResult, onClick],
|
||||||
|
);
|
||||||
|
|
||||||
const objectLabel = useMemo(() => {
|
const objectLabel = useMemo(() => {
|
||||||
if (
|
if (
|
||||||
!config ||
|
!config ||
|
||||||
@ -57,6 +67,7 @@ export default function SearchThumbnail({
|
|||||||
<div className={`size-full ${imgLoaded ? "visible" : "invisible"}`}>
|
<div className={`size-full ${imgLoaded ? "visible" : "invisible"}`}>
|
||||||
<img
|
<img
|
||||||
ref={imgRef}
|
ref={imgRef}
|
||||||
|
onClick={handleOnClick}
|
||||||
className={cn(
|
className={cn(
|
||||||
"size-full select-none object-cover object-center opacity-100 transition-opacity",
|
"size-full select-none object-cover object-center opacity-100 transition-opacity",
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -554,13 +554,10 @@ export default function SearchView({
|
|||||||
ctrl: boolean,
|
ctrl: boolean,
|
||||||
detail: boolean,
|
detail: boolean,
|
||||||
) => {
|
) => {
|
||||||
if (detail && selectedObjects.length == 0) {
|
if (detail) {
|
||||||
setSearchDetail(value);
|
setSearchDetail(value);
|
||||||
} else {
|
} else {
|
||||||
onSelectSearch(
|
onSelectSearch(value, ctrl);
|
||||||
value,
|
|
||||||
ctrl || selectedObjects.length > 0,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user