Closed MichaelMdp closed 1 year ago
Might this be caused by this Livewire bug, @MichaelMdp? https://github.com/livewire/livewire/pull/6984
Could be this too https://github.com/livewire/livewire/pull/6889
Oh, I think I was actually looking to reference your PRs, @austincarpenter. 😄
Closing as this is most probably https://github.com/filamentphp/filament/pull/8633.
Package
filament/filament
Package Version
v3.0.62
Laravel Version
10.24.0
Livewire Version
v3.0.5
PHP Version
8.1.16
Problem description
On a filament forms select field: After you have a value selected for the an option, if you change the items created by the options closure (e.g.: remove an item from the list) The selected value is no longer selected in the UI, even if it has the exact same key.
When the property is flagged as a url param, you can refresh the page and the value is selected again.
It only seems to occur when an item, before the selected item, is removed from the options array. When the first item was selected and items after the selection are removed, it stays selected.
This was working in v2. this issue is only present for the native select.
Expected behavior
the selected value stays selected in the UI, even if the underlying options array is updated.
Steps to reproduce
artisan migrate:fresh go to the homepage / a form is visible with 2 dropdowns.
=> the initial selection is no longer visualised in the UI.
see App\Livewire\DropdownTest.php
Reproduction repository
https://github.com/MichaelMdp/filamentv3-options-update-issue
Relevant log output
No response