From 640b72e581d7afa0c42165d1e496450d0c68e92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Goszczy=C5=84ski?= Date: Sat, 14 Mar 2026 20:36:39 +0100 Subject: [PATCH] fix: desktop app comments adding --- packages/ui/src/components/line-comment.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/components/line-comment.tsx b/packages/ui/src/components/line-comment.tsx index ff5d1df007af..6b16d561d024 100644 --- a/packages/ui/src/components/line-comment.tsx +++ b/packages/ui/src/components/line-comment.tsx @@ -115,7 +115,12 @@ export const LineCommentAnchor = (props: LineCommentAnchorProps) => { on:mousedown={(e) => e.stopPropagation()} on:click={props.onClick as any} on:mouseenter={props.onMouseEnter as any} - on:focusout={props.onPopoverFocusOut as any} + on:focusout={(...args) => { + // Super ugly setTimeout to work around Safari's event handling + // where shadow DOM focusout event are updating UI before the button + // click event is called preventing to create click event. + return setTimeout(() => (props.onPopoverFocusOut as any)(...args), 0) + }} > {props.children}