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:
parent
da6a840d67
commit
3f3fb53f02
1 changed files with 6 additions and 1 deletions
|
|
@ -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>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue