fix seatch

This commit is contained in:
2025-04-25 17:06:10 -03:00
parent 311a66c5b0
commit cfe5cd648a

View File

@@ -3,7 +3,7 @@ import Fuse from "fuse.js";
// https://fusejs.io/api/options.html // https://fusejs.io/api/options.html
const options = { const options = {
keys: ["data.title", "data.excerpt", "data.slug"], keys: ["data.title", "data.slug"],
includeMatches: true, includeMatches: true,
minMatchCharLength: 2, minMatchCharLength: 2,
threshold: 0.5, threshold: 0.5,
@@ -28,12 +28,14 @@ export default function Search({ searchlist }) {
<input <input
id="search" id="search"
type="text" type="text"
className="focus:outline-none w-full pr-5 py-3.5" className="focus:outline-none w-full pr-5 py-3.5 rounded-r-xl"
value={query} value={query}
autoComplete="false"
onChange={onChange} onChange={onChange}
/> />
{query.length > 1 && ( {query.length > 1 && (
<div className="absolute w-full top-full bg-white mt-2.5 p-5 rounded-xl drop-shadow space-y-2.5"> <div className="absolute w-full top-full bg-white mt-1.5 p-5 rounded-xl drop-shadow space-y-2.5">
<p> <p>
Encontrado {items.length} resultado(s) para ' Encontrado {items.length} resultado(s) para '
<strong>{query}</strong>' <strong>{query}</strong>'