aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-02-10 11:04:37 +0100
committerlonkaars <l.leblansch@gmail.com>2021-02-10 11:04:37 +0100
commitda8d6e89ba9e70f166939f9294c4c52fd33003a1 (patch)
tree3ab911eb192941143f1b98196493d60381e9019c
parentfa7abcaacb80eac384e771d3c0aa19185a214e8a (diff)
added autocomplete to login/register pages
-rw-r--r--components/ui.tsx2
-rw-r--r--pages/login.tsx4
-rw-r--r--pages/register.tsx6
3 files changed, 7 insertions, 5 deletions
diff --git a/components/ui.tsx b/components/ui.tsx
index 3fb3c86..8f16340 100644
--- a/components/ui.tsx
+++ b/components/ui.tsx
@@ -95,6 +95,7 @@ export function Input(props: {
max?: number;
value?: string|number;
dark?: boolean;
+ autocomplete?: string;
}) {
return <input
id={props.id}
@@ -104,6 +105,7 @@ export function Input(props: {
spellCheck={false}
defaultValue={props.value ? String(props.value) : ""}
className={props.dark ? "dark" : "light"}
+ autoComplete={props.autocomplete}
style={{
padding: 12,
border: 0,
diff --git a/pages/login.tsx b/pages/login.tsx
index 42411f6..86066e6 100644
--- a/pages/login.tsx
+++ b/pages/login.tsx
@@ -45,8 +45,8 @@ export default function LoginPage() {
textAlign: "center"
}}>
<Vierkant>
- <Input id="email" label="email of gebruikersnaam" style={{ marginBottom: 12 }}></Input>
- <Input id="password" label="wachtwoord" type="password"></Input>
+ <Input autocomplete="username" id="email" label="email of gebruikersnaam" style={{ marginBottom: 12 }}></Input>
+ <Input autocomplete="current-password" id="password" label="wachtwoord" type="password"></Input>
<div style={{
marginTop: 24,
gridGap: 24,
diff --git a/pages/register.tsx b/pages/register.tsx
index 6e2c73f..4940580 100644
--- a/pages/register.tsx
+++ b/pages/register.tsx
@@ -79,9 +79,9 @@ export default function RegisterPage() {
}}>
<Vierkant>
<form>
- <Input id="username" label="gebruikersnaam" style={{ marginBottom: 12 }}></Input>
- <Input id="email" label="email" style={{ marginBottom: 12 }}></Input>
- <Input id="password" label="wachtwoord" type="password"></Input>
+ <Input autocomplete="username" id="username" label="gebruikersnaam" style={{ marginBottom: 12 }}></Input>
+ <Input autocomplete="email" id="email" label="email" style={{ marginBottom: 12 }}></Input>
+ <Input autocomplete="new-password" id="password" label="wachtwoord" type="password"></Input>
<Button text="Registreren" style={{ marginTop: 24 }} onclick={submitRegister}></Button>
</form>
</Vierkant>