Skip to content

Commit

Permalink
Fix default behavior bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelps12 committed Apr 19, 2024
1 parent f7b1341 commit 5f68924
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/web/src/components/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ export default function Main({ sidebarOpen }: { sidebarOpen: boolean }) {
autoFocus: true,
onChange: onValueChange,
onKeyDown: (e) => {
if (e.key === "Enter") {
if (e.key === "Enter" && !e.shiftKey) {
e.preventDefault();
onSend();
}
},
Expand Down Expand Up @@ -389,6 +390,7 @@ export default function Main({ sidebarOpen }: { sidebarOpen: boolean }) {
onChange: (e) => setValue(e.target.value),
onKeyDown: (e) => {
if (e.key === "Enter" && !e.shiftKey) {
e.preventDefault();
onSend();
}
},
Expand Down Expand Up @@ -508,6 +510,7 @@ export function Chat({
onChange: onValueChange,
onKeyDown: (e) => {
if (e.key === "Enter" && !e.shiftKey) {
e.preventDefault();
askQuestion();
}
},
Expand Down

0 comments on commit 5f68924

Please sign in to comment.