aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src
diff options
context:
space:
mode:
authorPelps12 <[email protected]>2024-04-19 00:49:32 -0500
committerPelps12 <[email protected]>2024-04-19 00:49:32 -0500
commit5f6892405e349e7cbf0bf987d62ba1bd20498c6a (patch)
tree2557b5062146795aa4cefcea47889d54ae84fc8d /apps/web/src
parentChange "Enter" submit logic (diff)
downloadsupermemory-5f6892405e349e7cbf0bf987d62ba1bd20498c6a.tar.xz
supermemory-5f6892405e349e7cbf0bf987d62ba1bd20498c6a.zip
Fix default behavior bug
Diffstat (limited to 'apps/web/src')
-rw-r--r--apps/web/src/components/Main.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/web/src/components/Main.tsx b/apps/web/src/components/Main.tsx
index 64650efd..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();
}
},
@@ -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();
}
},