feat: enter selects first model in list

This commit is contained in:
Aryan Kothari 2024-07-17 17:47:17 -04:00
parent 1e7a364c68
commit 133f223df6

View File

@ -238,6 +238,13 @@
class="w-full text-sm bg-transparent outline-none" class="w-full text-sm bg-transparent outline-none"
placeholder={searchPlaceholder} placeholder={searchPlaceholder}
autocomplete="off" autocomplete="off"
on:keydown={(e) => {
if (e.code === 'Enter' && filteredItems.length > 0) {
value = filteredItems[0].value;
show = false;
}
}}
/> />
</div> </div>