From 85f333b2fd3f9a17a297c6b0f9c594cdecb188f9 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 6 Mar 2022 22:52:41 -0800 Subject: [PATCH] fix: Finicky clicking on file attachments #2 --- shared/editor/marks/Link.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared/editor/marks/Link.tsx b/shared/editor/marks/Link.tsx index b9a25d5ea..efea8bcdb 100644 --- a/shared/editor/marks/Link.tsx +++ b/shared/editor/marks/Link.tsx @@ -176,7 +176,7 @@ export default class Link extends Mark { return false; } - if (event.target.classList.contains("attachment")) { + if (event.target.matches(".component-attachment *")) { return false; } @@ -211,6 +211,10 @@ export default class Link extends Mark { return false; } + if (event.target.matches(".component-attachment *")) { + return false; + } + // Prevent all default click behavior of links, see mousedown above // for custom link handling. if (this.options.onClickLink) {