From 09c4db8cdd6c48458e6486b141e0f97025faf5c0 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Tue, 25 May 2021 19:09:54 +0200 Subject: [PATCH] Fix keyboard submit --- src/App.svelte | 6 ++++-- src/base/orgs/View.svelte | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index b71b59479..10951186e 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -14,9 +14,11 @@ import Modal from '@app/Modal.svelte'; function handleKeydown(event: KeyboardEvent) { - // TODO: Fix this when there's a modal. if (event.key === 'Enter') { - (document.querySelector('button.primary') as HTMLElement).click(); + let elems = document.querySelectorAll('button.primary') as NodeListOf; + if (elems.length == 1) { // We only allow this when there's one primary button. + elems[0].click(); + } } } diff --git a/src/base/orgs/View.svelte b/src/base/orgs/View.svelte index 2537aeb62..69a5ca2b9 100644 --- a/src/base/orgs/View.svelte +++ b/src/base/orgs/View.svelte @@ -152,7 +152,7 @@
{#if isOwner(org)} - {/if}