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) => { if (e.key === 'Enter' && !e.shiftKey) {