From 1133b630736dec687bea1126b3b449b571bb16c0 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 | 4 +++- 2 files changed, 5 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 c7f65ae..2ea371e 100644 --- a/src/components/Image/index.tsx +++ b/src/components/Image/index.tsx @@ -129,10 +129,12 @@ export default function Image({ alt={finalAlt} decoding="async" loading="lazy" + draggable={false} onLoad={handleLoad} onError={handleError} className={cn( - 'object-cover rounded-lg w-full h-full transition-opacity duration-500', + 'object-cover rounded-lg w-full h-full transition-opacity duration-500 pointer-events-none', + isLoading ? 'opacity-0' : 'opacity-100', className )} width={dim?.width}