Просмотр исходного кода

Merge pull request #14642 from ayanahye/fix-chat-title-error-message

fix: error message on chat title edit
Tim Jaeryang Baek 9 месяцев назад
Родитель
Сommit
7ef2345ba6
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      src/lib/components/layout/Sidebar/ChatItem.svelte

+ 4 - 3
src/lib/components/layout/Sidebar/ChatItem.svelte

@@ -204,9 +204,10 @@
 	const chatTitleInputKeydownHandler = (e) => {
 		if (e.key === 'Enter') {
 			e.preventDefault();
-			editChatTitle(id, chatTitle);
-			confirmEdit = false;
-			chatTitle = '';
+			setTimeout(() => {
+		                const input = document.getElementById(`chat-title-input-${id}`);
+		                if (input) input.blur();
+		        }, 0);
 		} else if (e.key === 'Escape') {
 			e.preventDefault();
 			confirmEdit = false;