Skip to content

Commit c093c73

Browse files
committed
expose index
1 parent 2b88d6f commit c093c73

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

resources/views/components/stack.blade.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
'size-full min-w-0 flex pointer-events-none [&>*]:pointer-events-auto',
88
]) !!} x-data="{
99
modalPosition: [null, null],
10-
get modalIndexReversed() { return findModalHistoryIndex(modalId, true); },
1110
get modalStackDirection() {
1211
const [px, py] = this.modalPosition;
1312
@@ -47,9 +46,9 @@
4746
return {
4847
'--dx': dx,
4948
'--dy': dy,
50-
'--i': this.modalIndexReversed,
49+
'--i': modalIndexReversed,
5150
transform: `scale(calc(1 - 0.05 * var(--i))) translate(calc(2rem * var(--dx) * var(--i)), calc(2rem * var(--dy) * var(--i)))`,
52-
opacity: this.modalIndexReversed <= 2 ? 1 : 0,
51+
opacity: modalIndexReversed <= 2 ? 1 : 0,
5352
};
5453
}
5554

resources/views/livewire/modal.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ class="fixed left-0 top-0 z-40 grid h-dvh w-full select-none overflow-hidden bg-
157157
get modalId() { return '{{ $id }}'; },
158158
get isModalActive() { return modalActiveId === this.modalId; },
159159
get modal() { return findModalById(this.modalId); },
160+
get modalIndex() { return findModalHistoryIndex(modalId); },
161+
get modalIndexReversed() { return findModalHistoryIndex(modalId, true); },
160162
get modalStack() { return this.modal?.stack ?? null; },
161163
get isModalStacked() { return modalActiveStack && modalActiveStack === this.modalStack; },
162164
}" class="flex size-full min-h-0 min-w-0 select-text" style="grid-area: stack;"

src/Livewire/Modal.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public function mount(null|string|bool $stack = null): void
3030

3131
public function render(): \Illuminate\Contracts\View\View
3232
{
33-
// @phpstan-ignore-next-line
3433
return view('livewire-modal::livewire.modal');
3534
}
3635
}

0 commit comments

Comments
 (0)