Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: respect IME composition state on Enter key send (#16922)

iwasaki2f36949bcca7
diff --git a/web/src/components/floating-chat-widget.tsx b/web/src/components/floating-chat-widget.tsx
index 53e0ce5031..5f94f243f8 100644
--- a/web/src/components/floating-chat-widget.tsx
+++ b/web/src/components/floating-chat-widget.tsx
@@ -495,7 +495,7 @@ const FloatingChatWidget = () => {
const handleKeyPress = useCallback(
(e: React.KeyboardEvent) => {
- if (e.key === 'Enter' && !e.shiftKey) {
+ if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {
e.preventDefault();
handleSendMessage();
}
diff --git a/web/src/components/message-input/next.tsx b/web/src/components/message-input/next.tsx
index 64e33886e4..952e462e4e 100644
--- a/web/src/components/message-input/next.tsx
+++ b/web/src/components/message-input/next.tsx
@@ -229,7 +229,7 @@ export function NextMessageInput({
}, [sendDisabled, isUploading, sendLoading, value, pressEnter]);
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
- if (e.key === 'Enter' && !e.shiftKey) {
+ if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {
e.preventDefault();
submit();
}