Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions components/ChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,9 @@ export const ChatInput = memo(forwardRef<ChatInputHandle, Props>(function ChatIn
return;
}

if (e.key === "Enter" && !e.shiftKey) {
// Soft keyboards rarely offer Shift+Enter; on the mobile breakpoint Enter
// inserts a newline and the Send button submits.
if (e.key === "Enter" && !e.shiftKey && !isMobile) {
e.preventDefault();
if (isStreaming && (onSteer || onFollowUp)) {
// Submit-during-run behavior comes from Settings (Steer current run
Expand All @@ -1250,7 +1252,7 @@ export const ChatInput = memo(forwardRef<ChatInputHandle, Props>(function ChatIn
}
}
},
[isStreaming, onSteer, onFollowUp, onAbort, onMinimize, slashMenuOpen, slashQuery, filteredSlashCommands, slashActiveIndex, applySlashCommand, sendQueued, handleSend, getNextSlashIndex, atMenuOpen, atQuery, atMatches, atActiveIndex, applyAtCompletion, historyMenuOpen, inputHistory, historyActiveIndex, applyHistoryInput, value, isRecording, isTranscribing, cancelDictation, stopDictation, toggleDictation]
[isMobile, isStreaming, onSteer, onFollowUp, onAbort, onMinimize, slashMenuOpen, slashQuery, filteredSlashCommands, slashActiveIndex, applySlashCommand, sendQueued, handleSend, getNextSlashIndex, atMenuOpen, atQuery, atMatches, atActiveIndex, applyAtCompletion, historyMenuOpen, inputHistory, historyActiveIndex, applyHistoryInput, value, isRecording, isTranscribing, cancelDictation, stopDictation, toggleDictation]
);

const handleInput = useCallback(() => {
Expand Down