feat: enhance image components with draggable attribute and context menu handling

This commit is contained in:
2026-03-08 21:53:32 +11:00
parent b185e0b129
commit 30a7725769
7 changed files with 26 additions and 14 deletions

View File

@@ -919,7 +919,7 @@ export const Message = as<'div', MessageProps>(
const handleContextMenu: MouseEventHandler<HTMLDivElement> = (evt) => {
if (evt.altKey || !window.getSelection()?.isCollapsed || edit) return;
const tag = (evt.target as any).tagName;
if (typeof tag === 'string' && tag.toLowerCase() === 'a') return;
if (typeof tag === 'string' && (tag.toLowerCase() === 'a' || tag.toLowerCase() === 'img')) return;
evt.preventDefault();
setMenuAnchor({
x: evt.clientX,
@@ -1297,7 +1297,7 @@ export const Event = as<'div', EventProps>(
const handleContextMenu: MouseEventHandler<HTMLDivElement> = (evt) => {
if (evt.altKey || !window.getSelection()?.isCollapsed) return;
const tag = (evt.target as any).tagName;
if (typeof tag === 'string' && tag.toLowerCase() === 'a') return;
if (typeof tag === 'string' && (tag.toLowerCase() === 'a' || tag.toLowerCase() === 'img')) return;
evt.preventDefault();
setMenuAnchor({
x: evt.clientX,