fix: set the input to be empty after pressing enter instead of showing a newline (#506)

This commit is contained in:
Alex Bäuerle 2024-04-01 10:07:06 -07:00 committed by GitHub
parent dac89a9720
commit 6d43b0ae88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) {