fix seatch
This commit is contained in:
@@ -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>'
|
||||||
|
|||||||
Reference in New Issue
Block a user