Skip to content

Commit 6654313

Browse files
committed
fix
1 parent d4fcd98 commit 6654313

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

resources/views/components/stack.blade.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
'pt-20 sm:p-5' => !$fullscreen,
88
'size-full min-w-0 flex pointer-events-none [&>*]:pointer-events-auto',
99
]) !!} x-data="{
10-
modalDirection: {{ $direction ? Js::from($direction) : '[0, 0]' }},
10+
modalDirection: {{ Js::from($direction) }},
1111
modalPosition: [null, null],
1212
computeModalDirection() {
1313
const [px, py] = this.modalPosition;
@@ -34,18 +34,20 @@
3434
return [px, py];
3535
},
3636
init() {
37-
@if (!$direction) this.$nextTick(() => {
38-
this.modalPosition = this.computeModalPosition();
39-
this.modalDirection = this.computeModalDirection();
40-
}); @endif
37+
if (!this.modalDirection) {
38+
this.$nextTick(() => {
39+
this.modalPosition = this.computeModalPosition();
40+
this.modalDirection = this.computeModalDirection();
41+
});
42+
}
4143
4244
},
4345
modalAttributes: {
4446
['x-show']() { return isModalStacked ? modalHistory.includes(modalId) : isModalActive; },
4547
['x-bind:inert']() { return !isModalActive },
4648
['x-bind:style']() {
4749
if (isModalStacked) {
48-
const [dx, dy] = this.modalDirection;
50+
const [dx, dy] = (this.modalDirection ?? [0, 0]);
4951
5052
return {
5153
'--dx': dx,

0 commit comments

Comments
 (0)