Skip to content

Commit

Permalink
fix: issue1178 (#1179)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjagielka authored Dec 6, 2023
1 parent 7b052ff commit 12281fd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lib/modal/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -124,27 +124,29 @@
<div on:keydown={handleKeys} on:wheel|preventDefault|nonpassive use:prepareFocus use:focusTrap on:click={onAutoClose} on:mousedown={onOutsideClose} class={twMerge(dialogClass, $$props.classDialog, ...getPlacementClasses())} tabindex="-1" aria-modal="true" role="dialog">
<div class="flex relative {sizes[size]} w-full max-h-full">
<!-- Modal content -->

<Frame rounded shadow {...$$restProps} class={frameClass}>
<!-- Modal header -->
{#if $$slots.header || title}
<Frame color={$$restProps.color} class="flex justify-between items-center p-4 rounded-t">
<Frame color={$$restProps.color} class="flex justify-between items-center p-4 rounded-t-lg">
<slot name="header">
<h3 class="text-xl font-semibold {$$restProps.color ? '' : 'text-gray-900 dark:text-white'} p-0">
{title}
</h3>
</slot>
{#if dismissable}<CloseButton name="Close modal" on:click={hide} color={$$restProps.color} />{/if}
</Frame>
{:else if dismissable}
<CloseButton name="Close modal" class="absolute top-3 end-2.5" on:click={hide} color={$$restProps.color} />
{/if}
<!-- Modal body -->
<div class={twMerge('p-6 space-y-6 flex-1 overflow-y-auto overscroll-contain', $$props.bodyClass)} on:keydown|stopPropagation={handleKeys} role="document" on:wheel|stopPropagation|passive>
{#if dismissable && !$$slots.header && !title}
<CloseButton name="Close modal" class="absolute top-3 end-2.5" on:click={hide} color={$$restProps.color} />
{/if}
<slot />
</div>
<!-- Modal footer -->
{#if $$slots.footer}
<Frame color={$$restProps.color} class="flex items-center p-6 space-x-2 rtl:space-x-reverse rounded-b">
<Frame color={$$restProps.color} class="flex items-center p-6 space-x-2 rtl:space-x-reverse rounded-b-lg">
<slot name="footer" />
</Frame>
{/if}
Expand Down

2 comments on commit 12281fd

@vercel
Copy link

@vercel vercel bot commented on 12281fd Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 12281fd Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.