Skip to content

Commit 21f3b51

Browse files
committed
fix(home): prevent empty submit fallthrough when sending with empty input
1 parent 326582f commit 21f3b51

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • apps/sim/app/workspace/[workspaceId]/home/components/user-input

apps/sim/app/workspace/[workspaceId]/home/components/user-input/user-input.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,8 @@ export function UserInput({
454454
(e: React.KeyboardEvent<HTMLTextAreaElement>) => {
455455
if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {
456456
e.preventDefault()
457-
if (isSendingRef.current && !valueRef.current.trim() && onEnterWhileEmptyRef.current?.()) {
457+
if (isSendingRef.current && !valueRef.current.trim()) {
458+
onEnterWhileEmptyRef.current?.()
458459
return
459460
}
460461
handleSubmit()

0 commit comments

Comments
 (0)