Scroll only the body of work dialogs, so there is one scrollbar

The native dialog scrolled too once its content outgrew the browser's
default max-height. It now clips to the viewport and only the body scrolls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-30 11:13:38 +02:00
co-authored by Claude Opus 5.5
parent f3d2b3e39e
commit e274a8d2b1
2 changed files with 21 additions and 3 deletions
@@ -22,9 +22,10 @@
wire:ignore.self
x-data="{ get isLocked() { return {{ $locked }}; } }"
x-on:cancel="if (isLocked) { $event.preventDefault(); }"
{{ $attributes->class(['m-auto w-[calc(100%-1rem)] rounded-2xl border border-neutral-300 bg-white p-0 text-neutral-900 shadow-2xl backdrop:bg-black/70 dark:border-[#3e4249] dark:bg-[#222427] dark:text-neutral-100', $width]) }}
{{ $attributes->class(['m-auto max-h-[calc(100dvh-2rem)] w-[calc(100%-1rem)] overflow-hidden rounded-2xl border border-neutral-300 bg-white p-0 text-neutral-900 shadow-2xl backdrop:bg-black/70 dark:border-[#3e4249] dark:bg-[#222427] dark:text-neutral-100', $width]) }}
>
<div class="flex max-h-[92vh] flex-col">
{{-- Only the body scrolls: the dialog itself never does (one scrollbar), and its border takes 2px. --}}
<div class="flex max-h-[calc(100dvh-2rem-2px)] flex-col">
@isset($header)
{{ $header }}
@else
@@ -42,7 +43,7 @@
</div>
@endisset
<div class="flex-1 overflow-y-auto">
<div class="min-h-0 flex-1 overflow-y-auto">
{{ $slot }}
</div>