Skip to content

Commit c69e8d0

Browse files
authored
fix: prevent adding newline in message text composer upon submitting with Enter key (#2729)
1 parent e7708fd commit c69e8d0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/TextareaComposer/TextareaComposer.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ export const TextareaComposer = ({
179179
});
180180
}
181181
} else if (shouldSubmit(event) && textareaRef.current) {
182+
if (event.key === 'Enter') {
183+
// prevent adding newline when submitting a message with
184+
event.preventDefault();
185+
}
182186
handleSubmit();
183187
textareaRef.current.selectionEnd = 0;
184188
}

0 commit comments

Comments
 (0)