Commit 9efc20e 1 parent 6d8234f commit 9efc20e Copy full SHA for 9efc20e
File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
- import { useMemo } from "react" ;
1
+ import { useCallback , useMemo } from "react" ;
2
2
import { useApiHost } from "@/api" ;
3
3
import { getIconForLabel } from "@/utils/iconUtil" ;
4
4
import useSWR from "swr" ;
@@ -33,6 +33,16 @@ export default function SearchThumbnail({
33
33
onClick ( searchResult , true , false ) ;
34
34
} ) ;
35
35
36
+ const handleOnClick = useCallback (
37
+ ( e : React . MouseEvent < HTMLDivElement > ) => {
38
+ if ( e . metaKey ) {
39
+ e . stopPropagation ( ) ;
40
+ onClick ( searchResult , true , false ) ;
41
+ }
42
+ } ,
43
+ [ searchResult , onClick ] ,
44
+ ) ;
45
+
36
46
const objectLabel = useMemo ( ( ) => {
37
47
if (
38
48
! config ||
@@ -57,6 +67,7 @@ export default function SearchThumbnail({
57
67
< div className = { `size-full ${ imgLoaded ? "visible" : "invisible" } ` } >
58
68
< img
59
69
ref = { imgRef }
70
+ onClick = { handleOnClick }
60
71
className = { cn (
61
72
"size-full select-none object-cover object-center opacity-100 transition-opacity" ,
62
73
) }
You can’t perform that action at this time.
0 commit comments