Add autocomplete attribute to Input component
This commit is contained in:
parent
f1a56b9f91
commit
64d8b75f3e
2 changed files with 4 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ const {
|
||||||
placeholder,
|
placeholder,
|
||||||
className,
|
className,
|
||||||
defaultStyles = true,
|
defaultStyles = true,
|
||||||
|
autocomplete = "on",
|
||||||
} = Astro.props;
|
} = Astro.props;
|
||||||
|
|
||||||
const styleList = className ? className.split(" ") : [];
|
const styleList = className ? className.split(" ") : [];
|
||||||
|
|
@ -21,6 +22,7 @@ interface Props {
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
defaultStyles?: boolean;
|
defaultStyles?: boolean;
|
||||||
|
autocomplete?: string;
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -31,4 +33,5 @@ interface Props {
|
||||||
value={defaultTextContent || ""}
|
value={defaultTextContent || ""}
|
||||||
type="text"
|
type="text"
|
||||||
class={styleList.map((style) => style).join(" ")}
|
class={styleList.map((style) => style).join(" ")}
|
||||||
|
autocomplete={autocomplete}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ export function getStaticPaths() {
|
||||||
placeholder={t("menu.search")}
|
placeholder={t("menu.search")}
|
||||||
defaultStyles={false}
|
defaultStyles={false}
|
||||||
transition:persist
|
transition:persist
|
||||||
|
autocomplete="off"
|
||||||
/>
|
/>
|
||||||
<div id="search-suggestions"></div>
|
<div id="search-suggestions"></div>
|
||||||
<div id="loading-content">Loading...</div>
|
<div id="loading-content">Loading...</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue