fix: prevent image context menu and drag

This commit is contained in:
codytseng 2025-10-24 22:59:53 +08:00
parent 1274942f64
commit 402bc91566
2 changed files with 4 additions and 2 deletions

View file

@ -33,7 +33,8 @@ export default function Emoji({
<img
src={emoji.url}
alt={emoji.shortcode}
className={cn('inline-block size-5 rounded-sm', classNames?.img)}
draggable={false}
className={cn('inline-block size-5 rounded-sm pointer-events-none', classNames?.img)}
onLoad={() => {
setHasError(false)
}}

View file

@ -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
)}