diff options
| author | Dhravya <[email protected]> | 2024-04-18 22:18:34 -0700 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-04-18 22:18:34 -0700 |
| commit | 07b639630a63a360cb96d14cdffd6f9ff5f14511 (patch) | |
| tree | 8a47981245dd0cd713a3458dab9aa218d4dd90ea | |
| parent | Change "Enter" submit logic (diff) | |
| download | supermemory-Pelps12/main.tar.xz supermemory-Pelps12/main.zip | |
fix: Hitting 'Enter' submits, but creates a newlinePelps12/main
| -rw-r--r-- | apps/web/src/components/Main.tsx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/web/src/components/Main.tsx b/apps/web/src/components/Main.tsx index 64650efd..74af7f5b 100644 --- a/apps/web/src/components/Main.tsx +++ b/apps/web/src/components/Main.tsx @@ -345,6 +345,7 @@ export default function Main({ sidebarOpen }: { sidebarOpen: boolean }) { onChange: onValueChange, onKeyDown: (e) => { if (e.key === "Enter") { + e.preventDefault(); onSend(); } }, @@ -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(); } }, @@ -508,6 +510,7 @@ export function Chat({ onChange: onValueChange, onKeyDown: (e) => { if (e.key === "Enter" && !e.shiftKey) { + e.preventDefault(); askQuestion(); } }, |