Closed t1m0t closed 6 months ago
Updated today and I'm having the same problem.
Not sure how related this is, but 1.17.10 also broke this for us. This breaks JS by treating the @
as a syntax error (I guess it is no longer being pre-processed). This worked fine up to 1.17.9, and 1.17.12 did not fix it:
<x-wireui.button
wire:click="$emit('openModal', 'my.modal.component', @js([$id]))"
...
The fix was to remove the @js()
and move the array into the JS domain ($id
is an integer for us, so no further encoding was needed):
<x-wireui.button
wire:click="$emit('openModal', 'my.modal.component', [{{ $id }}])"
...
Just posting this here as additional context in case it helps others when searching.
Note: I'm unclear where the @js
tag is coming from - Laravel, Livewire, WireUI or some other package.
I can raise this as a new issue if my original code should work, and wasn't fundamentally wrong to start with.
Describe the bug When upgrading to 1.17.10, my modals are opened on first render. In 1.17.9, behavior is as expected.
To Reproduce
Expected behavior Modals shouldn't open in first render.
Dependencies
Desktop (If applicable, please complete the following information):