forked from open-webui/open-webui
feat: arrowup edit message shortcut
This commit is contained in:
parent
b42050fec8
commit
7d859141b4
2 changed files with 24 additions and 2 deletions
|
@ -298,6 +298,24 @@
|
|||
submitPrompt(prompt);
|
||||
}
|
||||
}}
|
||||
on:keydown={(e) => {
|
||||
if (prompt === '' && e.key == 'ArrowUp') {
|
||||
e.preventDefault();
|
||||
|
||||
const userMessageElement = [
|
||||
...document.getElementsByClassName('user-message')
|
||||
]?.at(-1);
|
||||
|
||||
const editButton = [
|
||||
...document.getElementsByClassName('edit-user-message-button')
|
||||
]?.at(-1);
|
||||
|
||||
console.log(userMessageElement);
|
||||
|
||||
userMessageElement.scrollIntoView({ block: 'center' });
|
||||
editButton?.click();
|
||||
}
|
||||
}}
|
||||
rows="1"
|
||||
on:input={(e) => {
|
||||
e.target.style.height = '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue