Skip to content

Fix showing flyout #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/js/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ window.LivewireUIModal = () => {
this.activeComponent = id;
this.showActiveComponent = true;
this.modalWidth = this.getActiveComponentModalAttribute('maxWidthClass');
this.modalFlyout = this.getActiveComponentModalAttribute('displayAsFlyout');
this.modalFlyoutPosition = this.getActiveComponentModalAttribute('flyoutPosition');
this.modalFlyout = this.getActiveComponentModalAttribute('modalFlyout');
this.modalFlyoutPosition = this.getActiveComponentModalAttribute('modalFlyoutPosition');
}, 300);
}

Expand Down
17 changes: 10 additions & 7 deletions resources/views/modal.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@include('laravel-livewire-modal::modal-script', ['modalScript' => $modalScript])

<div x-data="LivewireUIModal()" x-on:close.stop="setShowPropertyTo(false)" wire:cloak
x-on:keydown.escape.window="show && closeModalOnEscape()" x-show="show" class="fixed inset-0 z-10 overflow-y-auto"
x-on:keydown.escape.window="show && closeModalOnEscape()" x-show="show" class="fixed inset-0 z-20 overflow-y-auto"
style="display: none;">

<div class="flex items-end justify-center min-h-dvh px-4 pt-4 pb-10 text-center sm:block sm:p-0">
Expand Down Expand Up @@ -40,8 +40,9 @@ class="inline-block w-full align-bottom bg-white rounded-lg text-left overflow-h
x-transition:leave="transform transition ease-in-out duration-300"
x-transition:leave-start="translate-x-0"
x-transition:leave-end="translate-x-full"
x-bind:class="[modalWidth, 'fixed h-full md:w-[25rem] top-0 right-0 border-s overflow-y-auto overflow-x-hidden
z-50 shadow-2xl modal-flyout-right bg-white dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 transform transition-all']"
x-bind:class="modalWidth"
class="fixed h-full md:w-[25rem] top-0 right-0 border-s overflow-y-auto overflow-x-hidden
z-50 shadow-2xl modal-flyout-right bg-white dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 transform transition-all"
id="modal-container-right" x-trap.noscroll="show && showActiveComponent && modalFlyout && modalFlyoutPosition === 'right'" aria-modal="true">
@include('laravel-livewire-modal::modal-content')
</div>
Expand All @@ -54,8 +55,9 @@ class="inline-block w-full align-bottom bg-white rounded-lg text-left overflow-h
x-transition:leave="transform transition ease-in-out duration-300"
x-transition:leave-start="translate-x-0"
x-transition:leave-end="-translate-x-full"
x-bind:class="[modalWidth, 'fixed h-full md:w-[25rem] top-0 left-0 border-e overflow-y-auto overflow-x-hidden
z-50 shadow-2xl modal-flyout-left bg-white dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 transform transition-all']"
x-bind:class="modalWidth"
class="fixed h-full md:w-[25rem] top-0 left-0 border-e overflow-y-auto overflow-x-hidden
z-50 shadow-2xl modal-flyout-left bg-white dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 transform transition-all"
id="modal-container-left" x-trap.noscroll="show && showActiveComponent && modalFlyout && modalFlyoutPosition === 'left'" aria-modal="true">
@include('laravel-livewire-modal::modal-content')
</div>
Expand All @@ -68,8 +70,9 @@ class="inline-block w-full align-bottom bg-white rounded-lg text-left overflow-h
x-transition:leave="transform transition ease-in-out duration-300"
x-transition:leave-start="translate-y-0"
x-transition:leave-end="translate-y-full"
x-bind:class="[modalWidth, 'fixed min-h-[25rem] w-screen min-w-[100vw] bottom-0 left-0 right-0 border-t overflow-y-auto overflow-x-hidden
z-50 shadow-2xl modal-flyout-bottom bg-white dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 transform transition-all']"
x-bind:class="modalWidth"
class="fixed min-h-[25rem] w-screen min-w-[100vw] bottom-0 left-0 right-0 border-t overflow-y-auto overflow-x-hidden
z-50 shadow-2xl modal-flyout-bottom bg-white dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 transform transition-all"
id="modal-container-bottom" x-trap.noscroll="show && showActiveComponent && modalFlyout && modalFlyoutPosition === 'bottom'" aria-modal="true">
@include('laravel-livewire-modal::modal-content')
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/Services/ModalManagerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public function createModalComponent(string $component, array $arguments = [], a
'destroyOnClose' => $componentClass::destroyOnClose(),
'maxWidth' => $componentClass::modalMaxWidth(),
'maxWidthClass' => $componentClass::modalMaxWidthClass(),
'modalFlyout' => $componentClass::modalFlyout(),
'modalFlyoutPosition' => $componentClass::modalFlyoutPosition(),
], $modalAttributes),
],
];
Expand Down