Open awcodes opened 6 months ago
This is a really interesting bug, and it seems to occur in Livewire itself when you change the order of keys in an existing array. Livewire stops seeing the x-data directive, even though it is present in the HTML ¯_(ツ)_/¯. The problem disappears when you use a new key (UUID) for existing array items.
https://github.com/filamentphp/filament/assets/4639175/466f81ca-69e9-4839-aeaf-2a6fc89af058
I'm not sure if this is a valid solution for the bug, but it provides some additional information.
Package
filament/filament
Package Version
v3.2.40
Laravel Version
v11.7.0
Livewire Version
v3.4.12
PHP Version
PHP 8.2.8
Problem description
When adding items with the addBetweenAction once there are 4-5 items in the state the last item looses its alpine data somehow resulting in alpine throwing up in the console because ‘isCollapsed’ is undefined.
But then it reinitializes itself. But continues to not have the alpine data set on any following actions.
So if you click on collapse all they all collapse except that one. But the bug still happens regardless of collapsible or not. addAction doesn’t seem to trigger the issue, probably because the new item is always at the end of the state array.
Expected behavior
Blocks do not loose their alpine x-data properties.
Steps to reproduce
https://github.com/filamentphp/filament/assets/3596800/1d114bbf-035b-4fe7-907f-b338a3157a64
Reproduction repository
https://github.com/awcodes/builder-bug
Relevant log output
Donate 💰 to fund this issue