feat: enhance image components with draggable attribute and context menu handling
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user