From df5a73f64f6c101bfd2615969031f275c38bd7eb Mon Sep 17 00:00:00 2001 From: Anton Kovalenko Date: Sun, 18 Jul 2021 00:31:56 +0300 Subject: [PATCH] PayFlow: hacky focus management for modal --- src/App.svelte | 2 +- src/InputMask.svelte | 3 +++ src/PayFlow.svelte | 8 ++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 3a943dd..a08d1fd 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -215,4 +215,4 @@ - + diff --git a/src/InputMask.svelte b/src/InputMask.svelte index 48acd75..8d6cbc2 100644 --- a/src/InputMask.svelte +++ b/src/InputMask.svelte @@ -16,6 +16,7 @@ let input; export let value = null; export let isComplete = false; + export let focusOnMount = false; let maskRef, imask, unmask, attrs; @@ -55,6 +56,8 @@ onMount(() => { maskRef = IMask(input, imask); + if (focusOnMount) + input.focus(); setValue(value); }); diff --git a/src/PayFlow.svelte b/src/PayFlow.svelte index 8b55f22..38c8987 100644 --- a/src/PayFlow.svelte +++ b/src/PayFlow.svelte @@ -10,6 +10,7 @@ import Tipped from './Tipped.svelte'; export let lnurl = undefined; + export let hasAmount; let isOpen; let res1; let res2; @@ -87,7 +88,9 @@ -cancelButton.focus()} size='lg'> + BOLT11 invoice: {stage} {#if confirmAmount} @@ -97,7 +100,8 @@
{#key minSendSat}