From c8604515d65902934a6c5e011898943deba3a769 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Fri, 6 May 2022 03:19:52 +0300 Subject: [PATCH] frontend: perform primary action in most modals by pressing enter --- frontend/src/components/overlays/CreateAccount.svelte | 8 +++++++- frontend/src/components/overlays/CreateChannel.svelte | 8 +++++++- frontend/src/components/overlays/EditChannel.svelte | 8 +++++++- frontend/src/components/overlays/EditMessage.svelte | 8 +++++++- frontend/src/components/overlays/Login.svelte | 8 +++++++- 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/overlays/CreateAccount.svelte b/frontend/src/components/overlays/CreateAccount.svelte index 0dd7e65..c902a83 100644 --- a/frontend/src/components/overlays/CreateAccount.svelte +++ b/frontend/src/components/overlays/CreateAccount.svelte @@ -40,6 +40,12 @@ import { maybeFly } from "../../animations"; overlayStore.open("login", {}); } }; + const onKeydown = async (e) => { + if (e.code !== "Enter") + return; + + await create(); + }; -