From b66365e2ea281dcda9ea008af56137ef6aab0dff Mon Sep 17 00:00:00 2001 From: martincupela Date: Tue, 7 Oct 2025 16:33:47 +0200 Subject: [PATCH] fix(TextareaComposer): check sendable data before allowing message submission --- src/components/TextareaComposer/TextareaComposer.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/TextareaComposer/TextareaComposer.tsx b/src/components/TextareaComposer/TextareaComposer.tsx index cd203f4a3..7b19c2c95 100644 --- a/src/components/TextareaComposer/TextareaComposer.tsx +++ b/src/components/TextareaComposer/TextareaComposer.tsx @@ -194,7 +194,11 @@ export const TextareaComposer = ({ return nextIndex; }); } - } else if (shouldSubmit(event) && textareaRef.current) { + } else if ( + shouldSubmit(event) && + textareaRef.current && + messageComposer.hasSendableData + ) { if (event.key === 'Enter') { // prevent adding newline when submitting a message with event.preventDefault(); @@ -205,6 +209,7 @@ export const TextareaComposer = ({ [ focusedItemIndex, handleSubmit, + messageComposer, onKeyDown, shouldSubmit, suggestions,