Skip to content

Commit

Permalink
Enable closing modals by clicking backdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
myieye committed Jul 25, 2023
1 parent b4718f7 commit d800b71
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/src/lib/components/modals/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@

{#if $open}
<!-- using DaisyUI modal https://daisyui.com/components/modal/ -->
<dialog bind:this={dialog} class="modal justify-items-center" class:modal-bottom={bottom} on:cancel={cancelModal}>
<dialog
bind:this={dialog}
class="modal justify-items-center"
class:modal-bottom={bottom}
on:cancel={cancelModal}
on:close={cancelModal}
>
<div class="modal-box max-w-3xl">
{#if showCloseButton}
<button class="btn btn-sm btn-circle absolute right-2 top-2" aria-label={$t('close')} on:click={cancelModal}
Expand All @@ -107,5 +113,8 @@
</div>
{/if}
</div>
<form method="dialog" class="modal-backdrop">
<button>invisible</button>
</form>
</dialog>
{/if}

0 comments on commit d800b71

Please sign in to comment.