An interesting issue on @LaravelLivewire and @Alpine_JS while removing elements on a list using events
This is hard to explain on a tweet, so please read the full thread. https://github.com/livewire/livewire/issues/763
This is hard to explain on a tweet, so please read the full thread. https://github.com/livewire/livewire/issues/763
I have a list; each element on the list can be removed by calling an event.
If you hardcode the event arguments, and remove the element, let's say #5 in the list, and then call the same event on element #6 (now in position #5), you'll get the values you had for the removed #5
If you hardcode the event arguments, and remove the element, let's say #5 in the list, and then call the same event on element #6 (now in position #5), you'll get the values you had for the removed #5
The solution is to pass the event arguments as a reference and not as hardcoded values.
To learn more about, take a look at this thread on GitHub https://github.com/livewire/livewire/issues/763
To learn more about, take a look at this thread on GitHub https://github.com/livewire/livewire/issues/763