mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 13:55:19 +00:00
fix: check filteredItems length before unsafe index access
This commit is contained in:
parent
dbf88a2eca
commit
fbef731a04
1 changed files with 1 additions and 1 deletions
|
|
@ -243,7 +243,7 @@
|
||||||
placeholder={searchPlaceholder}
|
placeholder={searchPlaceholder}
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
on:keydown={(e) => {
|
on:keydown={(e) => {
|
||||||
if (e.code === 'Enter') {
|
if (e.code === 'Enter' && filteredItems.length > 0) {
|
||||||
value = filteredItems[selectedModelIdx].value;
|
value = filteredItems[selectedModelIdx].value;
|
||||||
show = false;
|
show = false;
|
||||||
return; // dont need to scroll on selection
|
return; // dont need to scroll on selection
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue