mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-02 02:12:25 +00:00
refac
This commit is contained in:
parent
14be67348a
commit
85146206f6
1 changed files with 12 additions and 4 deletions
|
|
@ -400,12 +400,20 @@
|
|||
let showDeleteConfirm = false;
|
||||
|
||||
const chatTitleInputKeydownHandler = (e) => {
|
||||
// Let Enter and Escape finish IME composition without saving or cancelling the rename.
|
||||
if (e.isComposing || e.keyCode === 229) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
setTimeout(() => {
|
||||
const input = document.getElementById(`chat-title-input-${id}`);
|
||||
if (input) input.blur();
|
||||
}, 0);
|
||||
|
||||
if (chatTitle !== title) {
|
||||
editChatTitle(id, chatTitle);
|
||||
}
|
||||
|
||||
confirmEdit = false;
|
||||
chatTitle = '';
|
||||
} else if (e.key === 'Escape') {
|
||||
e.preventDefault();
|
||||
confirmEdit = false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue