From 402bc915661ba10768de69cb193238bdd6f3653c Mon Sep 17 00:00:00 2001 From: codytseng Date: Fri, 24 Oct 2025 22:59:53 +0800 Subject: [PATCH] fix: prevent image context menu and drag --- src/components/Emoji/index.tsx | 3 ++- src/components/Image/index.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Emoji/index.tsx b/src/components/Emoji/index.tsx index 00501c4..36be7cd 100644 --- a/src/components/Emoji/index.tsx +++ b/src/components/Emoji/index.tsx @@ -33,7 +33,8 @@ export default function Emoji({ {emoji.shortcode} { setHasError(false) }} diff --git a/src/components/Image/index.tsx b/src/components/Image/index.tsx index 06241ba..fb6fe2b 100644 --- a/src/components/Image/index.tsx +++ b/src/components/Image/index.tsx @@ -90,11 +90,12 @@ export default function Image({ alt={alt} decoding="async" loading="lazy" + draggable={false} {...props} onLoad={handleLoad} onError={handleError} className={cn( - 'object-cover rounded-lg w-full h-full transition-opacity', + 'object-cover rounded-lg w-full h-full transition-opacity pointer-events-none', isLoading ? 'opacity-0' : 'opacity-100', className )}