vincent15000's avatar

Livewire + Alpine + Alpine sort plugin

Hello,

I have started another post with a similar subject.

https://laracasts.com/discuss/channels/javascript/sort-items-with-alpinejs-display-bug

As I have found new elements about this bug, I prefer start a new post.

I have tried this.

public function sortGroups($ids)
{
	//
}
...

<div
	x-data="{
		sort() {
			const ids = [...];
			$wire.sortGroups({ ids: ids });
		},
	}"
>
	<div x-sort="sort">
		<div x-sort:item>
			...
		</div>
	</div>
</div>

What I don't understand is that even if the sortGroups function is empty, as soon as I drop an item on the last position, the previous items that was in the last position disappears. And this happens only if I move an item to the last position ; with all other positions, it works fine.

If I remove $wire.sortGroups(), the item doesn't disappear.

I'm searching for a solution for days now without any success.

Can anybody help me understand what's going on, please ?

Thanks a lot.

V

0 likes
2 replies

Please or to participate in this conversation.