mirror of
https://github.com/open-webui/open-webui
synced 2025-05-27 16:49:30 +00:00
feat: submit chat title rename with Enter, cancel with ESC
This commit is contained in:
parent
b03fc97e28
commit
3b624f35ac
@ -198,6 +198,19 @@
|
||||
});
|
||||
|
||||
let showDeleteConfirm = false;
|
||||
|
||||
const keyDownEvent = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
editChatTitle(id, chatTitle);
|
||||
confirmEdit = false;
|
||||
chatTitle = '';
|
||||
} else if (e.key === 'Escape') {
|
||||
e.preventDefault();
|
||||
confirmEdit = false;
|
||||
chatTitle = '';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<ShareChatModal bind:show={showShareChatModal} chatId={id} />
|
||||
@ -246,6 +259,7 @@
|
||||
bind:value={chatTitle}
|
||||
id="chat-title-input-{id}"
|
||||
class=" bg-transparent w-full outline-hidden mr-10"
|
||||
on:keydown={keyDownEvent}
|
||||
/>
|
||||
</div>
|
||||
{:else}
|
||||
|
Loading…
Reference in New Issue
Block a user