mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-01-29 01:28:29 +00:00
prevent msg ctx menu from open on text selection
This commit is contained in:
parent
e20e67aee3
commit
edd390f483
|
@ -696,7 +696,7 @@ export const Message = as<'div', MessageProps>(
|
|||
const hideOptions = () => setHover(false);
|
||||
|
||||
const handleContextMenu: MouseEventHandler<HTMLDivElement> = (evt) => {
|
||||
if (evt.altKey) return;
|
||||
if (evt.altKey || !window.getSelection()?.isCollapsed) return;
|
||||
const tag = (evt.target as any).tagName;
|
||||
if (typeof tag === 'string' && tag.toLowerCase() === 'a') return;
|
||||
evt.preventDefault();
|
||||
|
@ -965,7 +965,7 @@ export const Event = as<'div', EventProps>(
|
|||
const hideOptions = () => setHover(false);
|
||||
|
||||
const handleContextMenu: MouseEventHandler<HTMLDivElement> = (evt) => {
|
||||
if (evt.altKey) return;
|
||||
if (evt.altKey || !window.getSelection()?.isCollapsed) return;
|
||||
const tag = (evt.target as any).tagName;
|
||||
if (typeof tag === 'string' && tag.toLowerCase() === 'a') return;
|
||||
evt.preventDefault();
|
||||
|
|
Loading…
Reference in a new issue