Skip to content

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

Fix: Upload an image without filling in any text and press Enter; the image should not disappear. (#17632)

balibabucb28bd4e7e71
diff --git a/web/src/components/message-input/next.tsx b/web/src/components/message-input/next.tsx
index e3a0888c2a..f4dc9364a4 100644
--- a/web/src/components/message-input/next.tsx
+++ b/web/src/components/message-input/next.tsx
@@ -152,10 +152,13 @@ export function NextMessageInput({
}, []);
const submit = React.useCallback(() => {
- if (isUploading || sendLoading) return;
+ // Mirror the send button's disabled condition so pressing Enter with an
+ // empty message does nothing — previously it cleared the uploaded file
+ // list without sending anything.
+ if (sendDisabled || isUploading || sendLoading || !value.trim()) return;
pressEnter();
setFiles([]);
- }, [isUploading, sendLoading, pressEnter]);
+ }, [sendDisabled, isUploading, sendLoading, value, pressEnter]);
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (e.key === 'Enter' && !e.shiftKey) {