add clear search input button

This commit is contained in:
isUnknown 2024-04-09 18:58:31 +02:00
parent 2f8ceb831e
commit 53b72e85b9
3 changed files with 21 additions and 4 deletions

View file

@ -22,10 +22,18 @@
x-model="search"
>
<img
x-show="search.length === 0"
src="<?= url('assets/images/icons/search.svg') ?>"
class="search__icon"
alt="Icône loupe indiquant le champ de recherche."
>
<button
x-show="search.length > 0"
@click="search = ''"
class="search__icon"
>
<img src="<?= url('assets/images/icons/close.svg') ?>" alt="">
</button>
</div>
<ul class="panel__items">
<?php foreach($kirby->collection('years') as $year): ?>