From 7a0130a118a9fd5d7e593f315c6418f5fd6555f7 Mon Sep 17 00:00:00 2001 From: gcw_VNOUEmGJ Date: Tue, 10 Mar 2026 17:17:43 +0800 Subject: [PATCH] fix: prevent @ in pasted content from triggering mention mode Closes #54 - Close active mention state before pasting plain text - Prevent mention detection in the input event immediately after paste - This fixes the issue where pasting text containing @ would incorrectly trigger mention mode --- .../src/flow_chat/components/RichTextInput.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/web-ui/src/flow_chat/components/RichTextInput.tsx b/src/web-ui/src/flow_chat/components/RichTextInput.tsx index bac2f9d3..2442bde8 100644 --- a/src/web-ui/src/flow_chat/components/RichTextInput.tsx +++ b/src/web-ui/src/flow_chat/components/RichTextInput.tsx @@ -330,10 +330,21 @@ export const RichTextInput = React.forwardRef { + isComposingRef.current = false; + }); + }, [onMentionStateChange]); const handleKeyDown = useCallback((e: React.KeyboardEvent) => { const nativeIsComposing = (e.nativeEvent as KeyboardEvent).isComposing;