Allow enter keypress to submit login form
This commit is contained in:
parent
c3daa8bc61
commit
5c950291f3
|
@ -82,6 +82,7 @@
|
||||||
on:blur
|
on:blur
|
||||||
on:focus
|
on:focus
|
||||||
on:input
|
on:input
|
||||||
|
on:keyup
|
||||||
on:blur={onBlur}
|
on:blur={onBlur}
|
||||||
on:focus={onFocus}
|
on:focus={onFocus}
|
||||||
on:input={onInput}
|
on:input={onInput}
|
||||||
|
|
|
@ -34,5 +34,6 @@
|
||||||
on:input
|
on:input
|
||||||
on:blur
|
on:blur
|
||||||
on:focus
|
on:focus
|
||||||
|
on:keyup
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
|
|
|
@ -33,6 +33,12 @@
|
||||||
notifications.error("Invalid credentials")
|
notifications.error("Invalid credentials")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const submitOnEnter = e => {
|
||||||
|
if (e.key === "Enter") {
|
||||||
|
login()
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="login">
|
<div class="login">
|
||||||
|
@ -46,12 +52,13 @@
|
||||||
<Divider noGrid />
|
<Divider noGrid />
|
||||||
<Layout gap="XS" noPadding>
|
<Layout gap="XS" noPadding>
|
||||||
<Body size="S" textAlign="center">Sign in with email</Body>
|
<Body size="S" textAlign="center">Sign in with email</Body>
|
||||||
<Input label="Email" bind:value={username} />
|
<Input label="Email" bind:value={username} on:keyup={submitOnEnter} />
|
||||||
<Input
|
<Input
|
||||||
label="Password"
|
label="Password"
|
||||||
type="password"
|
type="password"
|
||||||
on:change
|
on:change
|
||||||
bind:value={password}
|
bind:value={password}
|
||||||
|
on:keyup={submitOnEnter}
|
||||||
/>
|
/>
|
||||||
</Layout>
|
</Layout>
|
||||||
<Layout gap="XS" noPadding>
|
<Layout gap="XS" noPadding>
|
||||||
|
|
Loading…
Reference in New Issue