From 7ed13d2b4cc2c8383d8a63bb9e891f7cf84d4e34 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 21 May 2021 13:27:27 +0100 Subject: [PATCH] Allow enter keypress to submit login form --- packages/bbui/src/Form/Core/TextField.svelte | 1 + packages/bbui/src/Form/Input.svelte | 1 + packages/builder/src/components/login/LoginForm.svelte | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/bbui/src/Form/Core/TextField.svelte b/packages/bbui/src/Form/Core/TextField.svelte index e1793c74a6..650aee4f82 100644 --- a/packages/bbui/src/Form/Core/TextField.svelte +++ b/packages/bbui/src/Form/Core/TextField.svelte @@ -82,6 +82,7 @@ on:blur on:focus on:input + on:keyup on:blur={onBlur} on:focus={onFocus} on:input={onInput} diff --git a/packages/bbui/src/Form/Input.svelte b/packages/bbui/src/Form/Input.svelte index fcab178182..1d98982b4f 100644 --- a/packages/bbui/src/Form/Input.svelte +++ b/packages/bbui/src/Form/Input.svelte @@ -34,5 +34,6 @@ on:input on:blur on:focus + on:keyup /> diff --git a/packages/builder/src/components/login/LoginForm.svelte b/packages/builder/src/components/login/LoginForm.svelte index f3ecf5397b..b5ec67da8c 100644 --- a/packages/builder/src/components/login/LoginForm.svelte +++ b/packages/builder/src/components/login/LoginForm.svelte @@ -33,6 +33,12 @@ notifications.error("Invalid credentials") } } + + const submitOnEnter = e => { + if (e.key === "Enter") { + login() + } + }
@@ -46,12 +52,13 @@ Sign in with email - +