From eb38d382bab339427dc3194ab638cf5be74112b4 Mon Sep 17 00:00:00 2001 From: Aryan Kothari <87589047+thearyadev@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:31:17 -0400 Subject: [PATCH] fix: pseudoSelectedIndex is reset when modal is closed. --- src/lib/components/chat/ModelSelector/Selector.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/ModelSelector/Selector.svelte b/src/lib/components/chat/ModelSelector/Selector.svelte index c374b4598..b055cd4eb 100644 --- a/src/lib/components/chat/ModelSelector/Selector.svelte +++ b/src/lib/components/chat/ModelSelector/Selector.svelte @@ -45,7 +45,6 @@ let ollamaVersion = null; let pseudoSelectedIndex = 0; - let autoScrollTimeout; $: filteredItems = items.filter( (item) => @@ -206,6 +205,7 @@ bind:open={show} onOpenChange={async () => { searchValue = ''; + pseudoSelectedIndex = 0; // when the dropdown is closed, reset the selected index window.setTimeout(() => document.getElementById('model-search-input')?.focus(), 0); }} closeFocus={false}