PayFlow: hacky focus management for modal
This commit is contained in:
parent
3f5163fa55
commit
ceea807b81
@ -215,4 +215,4 @@
|
||||
</SiteCard>
|
||||
</SiteDeck>
|
||||
|
||||
<PayFlow bind:lnurl={getInvoiceFor}/>
|
||||
<PayFlow bind:lnurl={getInvoiceFor} hasAmount={amounts[payway.id]}/>
|
||||
|
@ -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);
|
||||
});
|
||||
|
||||
|
@ -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 @@
|
||||
|
||||
</script>
|
||||
|
||||
<Modal {isOpen} toggle={dismiss} on:open={()=>cancelButton.focus()} size='lg'>
|
||||
<Modal {isOpen} toggle={dismiss}
|
||||
on:open="{()=>{if (hasAmount) cancelButton.focus()}}"
|
||||
size='lg'>
|
||||
<ModalHeader>BOLT11 invoice: {stage}</ModalHeader>
|
||||
<ModalBody>
|
||||
{#if confirmAmount}
|
||||
@ -97,7 +100,7 @@
|
||||
<div class="input-group">
|
||||
{#key minSendSat}
|
||||
<InputMask bind:value={amount}
|
||||
autofocus
|
||||
focusOnMount={true}
|
||||
unmask
|
||||
imask={{
|
||||
mask: Number, scale:0,
|
||||
|
Loading…
Reference in New Issue
Block a user