diff options
| author | Dhravya Shah <[email protected]> | 2024-04-18 22:50:34 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-18 22:50:34 -0700 |
| commit | b23fadcc21126a126da870c06f5da5cd01ad437b (patch) | |
| tree | e720cc3ec3a4f9fcfe6bbb6aa17868e0ee7c8fae /apps/web/src | |
| parent | edit prompt (diff) | |
| parent | Fix default behavior bug (diff) | |
| download | supermemory-b23fadcc21126a126da870c06f5da5cd01ad437b.tar.xz supermemory-b23fadcc21126a126da870c06f5da5cd01ad437b.zip | |
Merge pull request #24 from Pelps12/main
Change "Enter" submit logic
Diffstat (limited to 'apps/web/src')
| -rw-r--r-- | apps/web/src/components/Main.tsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/web/src/components/Main.tsx b/apps/web/src/components/Main.tsx index b088b9f9..8ac52569 100644 --- a/apps/web/src/components/Main.tsx +++ b/apps/web/src/components/Main.tsx @@ -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(); } }, @@ -388,7 +389,8 @@ export default function Main({ sidebarOpen }: { sidebarOpen: boolean }) { autoFocus: true, onChange: (e) => setValue(e.target.value), onKeyDown: (e) => { - if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) { + if (e.key === "Enter" && !e.shiftKey) { + e.preventDefault(); onSend(); } }, @@ -507,7 +509,8 @@ export function Chat({ autoFocus: true, onChange: onValueChange, onKeyDown: (e) => { - if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) { + if (e.key === "Enter" && !e.shiftKey) { + e.preventDefault(); askQuestion(); } }, |