PayFlow: focus on cancel button on modal open

This commit is contained in:
Anton Kovalenko 2021-07-17 23:12:21 +03:00
parent e4dd6f8bcf
commit 3f5163fa55

@ -83,9 +83,11 @@
isOpen=false isOpen=false
} }
let cancelButton;
</script> </script>
<Modal {isOpen} toggle={dismiss} size='lg'> <Modal {isOpen} toggle={dismiss} on:open={()=>cancelButton.focus()} size='lg'>
<ModalHeader>BOLT11 invoice: {stage}</ModalHeader> <ModalHeader>BOLT11 invoice: {stage}</ModalHeader>
<ModalBody> <ModalBody>
{#if confirmAmount} {#if confirmAmount}
@ -158,6 +160,7 @@
{/if} {/if}
<button <button
class="btn btn-outline-primary" class="btn btn-outline-primary"
bind:this={cancelButton}
type="button" on:click="{dismiss}">Cancel</button> type="button" on:click="{dismiss}">Cancel</button>
</div> </div>
</ModalFooter> </ModalFooter>