Closed falko100 closed 11 months ago
Probably the same issue: $state returns the first element as well.
I'm not sure, but IIRC this has been fixed recently. Can you confirm, @falko100?
Sadly, not fixed yet. I reproduced in a new installation with Filament v3.0.62 Using this code:
Forms\Components\Repeater::make('Test repeater')
->schema([
Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
Forms\Components\Actions::make([
Forms\Components\Actions\Action::make('change-name')
->label('Change name')
->action(fn(Forms\Set $set) => $set('name', 'New name'))
])
]),
Alright, thanks for checking.
I'm still experiencing this behaviour in 3.0.97, for both $get
and $set
, any chance this will be addressed soon?
I'm getting a similar issue (3.0.92), though it's not specific to $set
, instead I'm attempting to allow for a modal form to display different data depending on the current record of the repeater, but it's always returning the first record.
I'm having the issue here as well. Is there a workaround for this? After some testing it looks like the state path for the actions are always pointing to the first repeater element. The parent action however works ok and the state path points to its right element.
I have a repeater with a file upload input and I need to add a download action button to download the private file but it downloads the first one only.
Fixed by #7454.
Package
filament/filament
Package Version
v3
Laravel Version
v10
Livewire Version
No response
PHP Version
8.2
Problem description
https://github.com/filamentphp/filament/assets/11974977/dc835296-2de6-43a7-a416-779934f87c03
Expected behavior
$set should target the entry within the repeater.
Steps to reproduce
Add an action to a repeater's schema and use the $set injection.
Reproduction repository
https://github.com/falko100/filament-bug/tree/bug-reproduction/repeater-set
Relevant log output
No response