site: bind search component open to items.length

Šis iesūtījums ir iekļauts:
Lucas Gabriel Vuotto 2025-04-28 15:58:00 +00:00
vecāks cc25efc5f4
iesūtījums bf21610576
2 izmainītas datnes ar 4 papildinājumiem un 5 izdzēšanām

Apskatīt datni

@ -25,7 +25,7 @@ document.addEventListener('alpine:init', () => {
return;
if (currentWord === this.currentWord) {
/* Show previous items, if any. */
this.open = true;
this.open = this.items.length > 0;
return;
}
this.currentWord = currentWord;
@ -35,12 +35,13 @@ document.addEventListener('alpine:init', () => {
if (!response.ok) {
this.items = [];
this.open = false;
return;
}
this.activeItem = null;
this.items = await response.json();
this.open = true;
this.open = this.items.length > 0;
},
async fetchSuggestionsOnInput(evt) {