mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-02-05 00:15:51 +01:00
Fix selection of tracked objects in Explore on desktop Safari (#16153)
* ensure meta click works on desktop safari to select objects in explore * don't break mobile
This commit is contained in:
parent
6d8234fa27
commit
9efc20e58a
@ -1,4 +1,4 @@
|
||||
import { useMemo } from "react";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { useApiHost } from "@/api";
|
||||
import { getIconForLabel } from "@/utils/iconUtil";
|
||||
import useSWR from "swr";
|
||||
@ -33,6 +33,16 @@ export default function SearchThumbnail({
|
||||
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(() => {
|
||||
if (
|
||||
!config ||
|
||||
@ -57,6 +67,7 @@ export default function SearchThumbnail({
|
||||
<div className={`size-full ${imgLoaded ? "visible" : "invisible"}`}>
|
||||
<img
|
||||
ref={imgRef}
|
||||
onClick={handleOnClick}
|
||||
className={cn(
|
||||
"size-full select-none object-cover object-center opacity-100 transition-opacity",
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user