Skip to content

Commit

Permalink
fix: set the input to be empty after pressing enter instead of showin…
Browse files Browse the repository at this point in the history
…g a newline (All-Hands-AI#506)
  • Loading branch information
Sparkier committed Apr 1, 2024
1 parent dac89a9 commit 6d43b0a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/components/ChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ function ChatInterface({ setSettingOpen }: Props): JSX.Element {
maxRows={10}
minRows={1}
variant="bordered"
onChange={(e) => setInputMessage(e.target.value)}
onChange={(e) =>
e.target.value !== "\n" && setInputMessage(e.target.value)
}
placeholder="Send a message (won't interrupt the Assistant)"
onKeyDown={(e) => {
if (e.key === "Enter" && !e.shiftKey) {
Expand Down

0 comments on commit 6d43b0a

Please sign in to comment.