Skip to content

Commit

Permalink
feat(library-create-button): add ScrollArea to Dialog.Content
Browse files Browse the repository at this point in the history
This commit wraps the slot inside the Dialog.Content with a ScrollArea
component. This change provides a scrollable area within the dialog,
improving the user experience when the dialog content is larger than
the viewport.
  • Loading branch information
eksno committed May 9, 2024
1 parent 3bf64a2 commit c98afea
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import * as Dialog from '$lib/components/ui/dialog';
import { Plus } from 'lucide-svelte';
import { ScrollArea } from '../scroll-area';
let open = false;
</script>
Expand All @@ -12,7 +13,9 @@
>
<Plus class="z-10 text-primary transition-all duration-300 group-hover:scale-150 " size="120" />
</Dialog.Trigger>
<Dialog.Content class="w-full sm:max-w-full lg:max-w-4xl">
<slot />
<Dialog.Content class="mt-2 flex h-[calc(100vh-4rem)] w-full flex-col sm:max-w-full lg:max-w-4xl">
<ScrollArea class="p-4">
<slot />
</ScrollArea>
</Dialog.Content>
</Dialog.Root>

0 comments on commit c98afea

Please sign in to comment.