Commit eb38d382 authored by Aryan Kothari's avatar Aryan Kothari
Browse files

fix: pseudoSelectedIndex is reset when modal is closed.

parent 5beaa5d8
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
let ollamaVersion = null; let ollamaVersion = null;
let pseudoSelectedIndex = 0; let pseudoSelectedIndex = 0;
let autoScrollTimeout;
$: filteredItems = items.filter( $: filteredItems = items.filter(
(item) => (item) =>
...@@ -206,6 +205,7 @@ ...@@ -206,6 +205,7 @@
bind:open={show} bind:open={show}
onOpenChange={async () => { onOpenChange={async () => {
searchValue = ''; searchValue = '';
pseudoSelectedIndex = 0; // when the dropdown is closed, reset the selected index
window.setTimeout(() => document.getElementById('model-search-input')?.focus(), 0); window.setTimeout(() => document.getElementById('model-search-input')?.focus(), 0);
}} }}
closeFocus={false} closeFocus={false}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment