Bläddra i källkod

fix: firefox input height issue

Timothy Jaeryang Baek 1 månad sedan
förälder
incheckning
74da9c4e54
2 ändrade filer med 12 tillägg och 10 borttagningar
  1. 8 7
      src/lib/components/chat/Chat.svelte
  2. 4 3
      src/lib/components/chat/Suggestions.svelte

+ 8 - 7
src/lib/components/chat/Chat.svelte

@@ -894,8 +894,8 @@
 				await chats.set(await getChatList(localStorage.token, $currentChatPage));
 			}
 		}
-		
-		taskId = null
+
+		taskId = null;
 	};
 
 	const chatActionHandler = async (chatId, actionId, modelId, responseMessageId, event = null) => {
@@ -1285,12 +1285,13 @@
 		prompt = '';
 
 		// Reset chat input textarea
-		const chatInputElement = document.getElementById('chat-input');
+		if (!($settings?.richTextInput ?? true)) {
+			const chatInputElement = document.getElementById('chat-input');
 
-		if (chatInputElement) {
-			await tick();
-			chatInputElement.style.height = '';
-			chatInputElement.style.height = Math.min(chatInputElement.scrollHeight, 320) + 'px';
+			if (chatInputElement) {
+				await tick();
+				chatInputElement.style.height = '';
+			}
 		}
 
 		const _files = JSON.parse(JSON.stringify(files));

+ 4 - 3
src/lib/components/chat/Suggestions.svelte

@@ -45,9 +45,10 @@
 		if (inputValue.length > 500) {
 			filteredPrompts = [];
 		} else {
-			const newFilteredPrompts = inputValue.trim()
-				? fuse.search(inputValue.trim()).map((result) => result.item)
-				: sortedPrompts;
+			const newFilteredPrompts =
+				inputValue.trim() && fuse
+					? fuse.search(inputValue.trim()).map((result) => result.item)
+					: sortedPrompts;
 
 			// Compare with the oldFilteredPrompts
 			// If there's a difference, update array + version