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
7eb14437
Commit
7eb14437
authored
Apr 20, 2024
by
Timothy J. Baek
Browse files
feat: shortcut
parent
9451726e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/lib/components/chat/Messages/UserMessage.svelte
src/lib/components/chat/Messages/UserMessage.svelte
+5
-4
No files found.
src/lib/components/chat/Messages/UserMessage.svelte
View file @
7eb14437
...
@@ -177,15 +177,15 @@
...
@@ -177,15 +177,15 @@
e.target.style.height = `${e.target.scrollHeight}px`;
e.target.style.height = `${e.target.scrollHeight}px`;
}}
}}
on:keydown={(e) => {
on:keydown={(e) => {
const isCmdOrCtrlPressed = e.metaKey || e.ctrlKey;
if (e.key === 'Escape') {
document.getElementById('close-edit-message-button')?.click();
}
// Check if Enter key is pressed
const isCmdOrCtrlPressed = e.metaKey || e.ctrlKey;
const isEnterPressed = e.key === 'Enter';
const isEnterPressed = e.key === 'Enter';
// Check if both Cmd/Ctrl and Enter are pressed simultaneously
if (isCmdOrCtrlPressed && isEnterPressed) {
if (isCmdOrCtrlPressed && isEnterPressed) {
document.getElementById('save-edit-message-button')?.click();
document.getElementById('save-edit-message-button')?.click();
console.log('Cmd/Ctrl + Enter is pressed');
}
}
}}
}}
/>
/>
...
@@ -202,6 +202,7 @@
...
@@ -202,6 +202,7 @@
</button>
</button>
<button
<button
id="close-edit-message-button"
class=" px-4 py-2 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-100 transition outline outline-1 outline-gray-200 dark:outline-gray-600 rounded-lg"
class=" px-4 py-2 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-100 transition outline outline-1 outline-gray-200 dark:outline-gray-600 rounded-lg"
on:click={() => {
on:click={() => {
cancelEditMessage();
cancelEditMessage();
...
...
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