mirror of
https://github.com/open-webui/open-webui
synced 2025-05-29 01:32:27 +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;
|
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>
|
</script>
|
||||||
|
|
||||||
<ShareChatModal bind:show={showShareChatModal} chatId={id} />
|
<ShareChatModal bind:show={showShareChatModal} chatId={id} />
|
||||||
@ -246,6 +259,7 @@
|
|||||||
bind:value={chatTitle}
|
bind:value={chatTitle}
|
||||||
id="chat-title-input-{id}"
|
id="chat-title-input-{id}"
|
||||||
class=" bg-transparent w-full outline-hidden mr-10"
|
class=" bg-transparent w-full outline-hidden mr-10"
|
||||||
|
on:keydown={keyDownEvent}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
|
Loading…
Reference in New Issue
Block a user