We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50e3c62 commit 4300ed6Copy full SHA for 4300ed6
src/components/TextareaComposer/TextareaComposer.tsx
@@ -194,7 +194,11 @@ export const TextareaComposer = ({
194
return nextIndex;
195
});
196
}
197
- } else if (shouldSubmit(event) && textareaRef.current) {
+ } else if (
198
+ shouldSubmit(event) &&
199
+ textareaRef.current &&
200
+ messageComposer.hasSendableData
201
+ ) {
202
if (event.key === 'Enter') {
203
// prevent adding newline when submitting a message with
204
event.preventDefault();
@@ -205,6 +209,7 @@ export const TextareaComposer = ({
205
209
[
206
210
focusedItemIndex,
207
211
handleSubmit,
212
+ messageComposer,
208
213
onKeyDown,
214
shouldSubmit,
215
suggestions,
0 commit comments