diff --git a/packages/actions/src/Concerns/CanOpenModal.php b/packages/actions/src/Concerns/CanOpenModal.php index 264fbcb497..865b98d161 100644 --- a/packages/actions/src/Concerns/CanOpenModal.php +++ b/packages/actions/src/Concerns/CanOpenModal.php @@ -79,6 +79,7 @@ trait CanOpenModal protected bool | Closure | null $hasModalCloseButton = null; protected bool | Closure | null $isModalClosedByClickingAway = null; + protected bool | Closure | null $isModalClosedByHittingEscape = null; protected string | Closure | null $modalIcon = null; diff --git a/packages/support/resources/views/components/button/index.blade.php b/packages/support/resources/views/components/button/index.blade.php index 9388814b55..10d02df055 100644 --- a/packages/support/resources/views/components/button/index.blade.php +++ b/packages/support/resources/views/components/button/index.blade.php @@ -98,7 +98,7 @@ 'ring-1 ring-gray-950/10 dark:ring-white/20' => (($color === 'gray') || ($tag === 'label')) && (! $grouped), 'bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500 dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50' => ($color !== 'gray') && ($tag !== 'label'), '[input:checked+&]:bg-custom-600 [input:checked+&]:text-white [input:checked+&]:ring-0 [input:checked+&]:hover:bg-custom-500 dark:[input:checked+&]:bg-custom-500 dark:[input:checked+&]:hover:bg-custom-400 [input:checked:focus-visible+&]:ring-custom-500/50 dark:[input:checked:focus-visible+&]:ring-custom-400/50 [input:focus-visible+&]:z-10 [input:focus-visible+&]:ring-2 [input:focus-visible+&]:ring-gray-950/10 dark:[input:focus-visible+&]:ring-white/20' => ($color !== 'gray') && ($tag === 'label'), - ] + ] ), ]); diff --git a/packages/support/resources/views/components/modal/index.blade.php b/packages/support/resources/views/components/modal/index.blade.php index 14682c1389..1e107f8ee3 100644 --- a/packages/support/resources/views/components/modal/index.blade.php +++ b/packages/support/resources/views/components/modal/index.blade.php @@ -24,7 +24,6 @@ 'id' => null, 'openEventName' => 'open-modal', 'slideOver' => false, - 'closeToAction' => true, 'stickyFooter' => false, 'stickyHeader' => false, 'trigger' => null, @@ -160,7 +159,6 @@ @if ($closeByHittingEscape) x-on:keydown.window.escape="{{ $closeEventHandler }}" @endif - x-show="isShown" x-transition:enter="duration-300" x-transition:leave="duration-300" @@ -180,10 +178,9 @@ ($extraModalWindowAttributeBag ?? new \Illuminate\View\ComponentAttributeBag())->class([ 'fi-modal-window pointer-events-auto relative row-start-2 flex w-full cursor-default flex-col bg-white shadow-xl ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10', 'fi-modal-slide-over-window ms-auto overflow-y-auto' => $slideOver, - 'p-10 border border-red-300 shadow shadow-4xl' => $closeToAction, // Using an arbitrary value instead of the h-dvh class that was added in Tailwind CSS v3.4.0 // to ensure compatibility with custom themes that may use an older version of Tailwind CSS. - 'h-[100dvh]' => ($slideOver || ($width === MaxWidth::Screen)) && !$closeToAction, + 'h-[100dvh]' => $slideOver || ($width === MaxWidth::Screen), 'mx-auto rounded-xl' => ! ($slideOver || ($width === MaxWidth::Screen)), 'hidden' => ! $visible, match ($width) { diff --git a/packages/support/src/View/Components/Modal.php b/packages/support/src/View/Components/Modal.php index 3127febf18..8fd281fe33 100644 --- a/packages/support/src/View/Components/Modal.php +++ b/packages/support/src/View/Components/Modal.php @@ -7,6 +7,7 @@ class Modal public static bool $hasCloseButton = true; public static bool $isClosedByClickingAway = true; + public static bool $isClosedByHittingEscape = true; public static function closeButton(bool $condition = true): void