Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
f1d23408
Commit
f1d23408
authored
Apr 27, 2024
by
Timothy J. Baek
Browse files
enhancement: disable submit via enter on mobile
parent
e71ef421
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
src/lib/components/chat/MessageInput.svelte
src/lib/components/chat/MessageInput.svelte
+7
-6
No files found.
src/lib/components/chat/MessageInput.svelte
View file @
f1d23408
...
@@ -689,13 +689,14 @@
...
@@ -689,13 +689,14 @@
: $i18n.t('Send a Message')}
: $i18n.t('Send a Message')}
bind:value={prompt}
bind:value={prompt}
on:keypress={(e) => {
on:keypress={(e) => {
if (window.innerWidth > 1024) {
if (e.keyCode == 13 && !e.shiftKey) {
if (e.keyCode == 13 && !e.shiftKey) {
e.preventDefault();
e.preventDefault();
}
}
if (prompt !== '' && e.keyCode == 13 && !e.shiftKey) {
if (prompt !== '' && e.keyCode == 13 && !e.shiftKey) {
// TODO: Only if screensize > xl
submitPrompt(prompt, user);
submitPrompt(prompt, user);
}
}
}
}}
}}
on:keydown={async (e) => {
on:keydown={async (e) => {
const isCtrlPressed = e.ctrlKey || e.metaKey; // metaKey is for Cmd key on Mac
const isCtrlPressed = e.ctrlKey || e.metaKey; // metaKey is for Cmd key on Mac
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment