feat(search): add keyword autocomplete to search field

Add HTML5 datalist autocomplete to search input using keywords from
database page. Users will see keyword suggestions as they type.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-02-10 16:23:48 +01:00
parent da6a840d67
commit 3f3fb53f02

View file

@ -4,7 +4,12 @@ de la vérité et de la justice.</p>
<form aria-label="Formulaire de recherche" class="search-form"> <form aria-label="Formulaire de recherche" class="search-form">
<span class="icon"><?= svg('assets/icons/search.svg') ?></span> <span class="icon"><?= svg('assets/icons/search.svg') ?></span>
<input type="text" id="search" class="input" placeholder="Rechercher"> <input type="text" id="search" class="input" placeholder="Rechercher" list="keywords-list">
<datalist id="keywords-list">
<?php foreach (page('database')->keywords()->split() as $keyword): ?>
<option value="<?= esc($keyword) ?>">
<?php endforeach ?>
</datalist>
</form> </form>