prefix: true, // Allow partial matches
processTerm: (term, _fieldName) => term.length < 3 ? null : term.toLowerCase()
},
- }, query: '', // The search query
+ },
+ querystring: '', // The search query
+ query: '', // The search query
medialibrary: '', // Holds URL of the media library that is passed in from the component
async init() {
return [];
}
- console.log(this.query);
-
return this.miniSearch.search(this.query);
},
type="search"
placeholder="Recherche"
@keyup.enter="$el.blur()" {{-- Remove focus on enter in order to hide virtual keyboard --}}
- x-model="query"
+ x-on:change="query=querystring"
+ x-model="querystring"
class="appearance-none outline-none bg-white
mt-8 w-full
font-semibold text-6xl uppercase
{{-- Search Results --}}
<div class="flex-1 max-h-full w-full overflow-y-auto"
- x-show="showResults"
+ x-show="searchOpen"
x-transition:enter.opacity.duration.500ms.delay.1500ms
x-transition:leave.opacity.delay.50ms>
- <div class="font-secondary font-medium">
+ <div x-show="query !== ''" class="font-secondary font-medium">
<p x-text="resultCount" class="mt-15 opacity-50"></p>
<div class="h-full max-h-full overflow-y-auto">