Add autocomplete attribute to Input component

This commit is contained in:
wearrrrr 2024-04-15 13:58:02 -05:00
parent f1a56b9f91
commit 64d8b75f3e
2 changed files with 4 additions and 0 deletions

View file

@ -6,6 +6,7 @@ const {
placeholder,
className,
defaultStyles = true,
autocomplete = "on",
} = Astro.props;
const styleList = className ? className.split(" ") : [];
@ -21,6 +22,7 @@ interface Props {
placeholder?: string;
className?: string;
defaultStyles?: boolean;
autocomplete?: string;
}
---
@ -31,4 +33,5 @@ interface Props {
value={defaultTextContent || ""}
type="text"
class={styleList.map((style) => style).join(" ")}
autocomplete={autocomplete}
/>

View file

@ -25,6 +25,7 @@ export function getStaticPaths() {
placeholder={t("menu.search")}
defaultStyles={false}
transition:persist
autocomplete="off"
/>
<div id="search-suggestions"></div>
<div id="loading-content">Loading...</div>