Filament not calling reorder action (repeater) on drag&drop
I have a form with a repeater.
The repeater reorder is working fine by using the moveUp/moveDown actions but the reorder action fails.
MountableAction->call is not called.
Looks like that we are failing on the HasFormComponentAction->getMountedFormComponentActionComponent() is returning null.
The ComponentKey is incorrectly filled with "data.myRepeaterPath" instead of the component key specified manually.
The issue seems to come from:
https://github.com/filamentphp/filament/blob/3.x/packages/forms/resources/views/components/repeater/index.blade.php#L75
How to properly solve the issue?
GitHub
filament/packages/forms/resources/views/components/repeater/index.b...
A powerful open source UI framework for Laravel β’ Build and ship admin panels & apps fast with Livewire - filamentphp/filament
12 Replies
up
Can you share some of your code? It's hard to follow.
the XHR call to livewire/update have the path repositoryDocuments instead of automaticDocuments failing to extract the correct component to perform the action into.
What's the reason you can't use
Repeater::make('automaticDocuments')
?I'm accessing the component to update it from other fields.
similar to:
https://filamentphp.com/docs/3.x/forms/advanced#dynamic-fields-based-on-a-select-option
as this is a a ->relationship() I have multiple repeaters with different keys on the same relation to identify the "condition" of the relationship.
So you have an extra query on for the relationship? Otherwise it would just load the same for all repeaters, right?
Might be a bug then
yea I have simplified the example. the issue seems to be caused by the blade file as it uses the statepath instead of the key.
on v4 you are using the key for what I've seen.
Can you try
->statePath('automaticDocuments')
instead of the key?
Not sure if the ->key()
is meant to be used for that.going to try, but then why the buttons perform the XHR call correctly with the key (mountFormComponentAction ) meanwhile the D&D does not intend to use the $key?
I have no idea. Could be a bug. Too much in my head right now to have a deeper look. Sorry.
NP π
if you have a minute to spare can you take a look to my other question?
(maybe you have a tip to do easily without forcing livewire to re-render the component forcefully by changing the key)