Regression in `Repeater` after updated from `v4.0.18`

After upgrading from v4.0.18 to v4.1.0 I have observed that I cannot delete item from Repeater, also observed that DeleteAction does not fire ->action() when the delete button pressed. I have rolledback to v4.0.18 and the problem is solved, then I have updated to v4.0.19 and the problem is there again. I have cleared all the caches using
php artisan optimize:clear
php artisan filament:optimize-clear
php artisan view:clear
php artisan filament:clear-cached-components
php artisan filament:assets
bun run build
php artisan optimize:clear
php artisan filament:optimize-clear
php artisan view:clear
php artisan filament:clear-cached-components
php artisan filament:assets
bun run build
You can see the regression in the video. Also not shown in the video but I have also
->deleteAction(function($action){
return $action->action(function (array $arguments, Repeater $component): void {
$items = $component->getRawState();

ray([
'items_before' => $items
]);
unset($items[$arguments['item']]);

ray([
'items_after' => $items
]);
$component->rawState($items);

$component->callAfterStateUpdated();

$component->shouldPartiallyRenderAfterActionsCalled() ? $component->partiallyRender() : null;
});
})
->addAction(function ($action) {
return $action->action(function (Repeater $component): void {
$newUuid = $component->generateUuid();

$items = $component->getRawState();

Log::info(json_encode([
'items_before' => $items
], JSON_THROW_ON_ERROR));

if ($newUuid) {
$items[$newUuid] = [];
} else {
$items[] = [];
}

Log::info(json_encode([
'items_after' => $items
], JSON_THROW_ON_ERROR));

$component->rawState($items);

$component->getChildSchema($newUuid ?? array_key_last($items))->fill();

$component->collapsed(false, shouldMakeComponentCollapsible: false);

$component->callAfterStateUpdated();

$component->shouldPartiallyRenderAfterActionsCalled() ? $component->partiallyRender() : null;
});
})
->deleteAction(function($action){
return $action->action(function (array $arguments, Repeater $component): void {
$items = $component->getRawState();

ray([
'items_before' => $items
]);
unset($items[$arguments['item']]);

ray([
'items_after' => $items
]);
$component->rawState($items);

$component->callAfterStateUpdated();

$component->shouldPartiallyRenderAfterActionsCalled() ? $component->partiallyRender() : null;
});
})
->addAction(function ($action) {
return $action->action(function (Repeater $component): void {
$newUuid = $component->generateUuid();

$items = $component->getRawState();

Log::info(json_encode([
'items_before' => $items
], JSON_THROW_ON_ERROR));

if ($newUuid) {
$items[$newUuid] = [];
} else {
$items[] = [];
}

Log::info(json_encode([
'items_after' => $items
], JSON_THROW_ON_ERROR));

$component->rawState($items);

$component->getChildSchema($newUuid ?? array_key_last($items))->fill();

$component->collapsed(false, shouldMakeComponentCollapsible: false);

$component->callAfterStateUpdated();

$component->shouldPartiallyRenderAfterActionsCalled() ? $component->partiallyRender() : null;
});
})
added to the Repeater to capture delete/add action and there is 2 ray() functions that logs the outputs but this does not called in v4.0.19 even though they are called in v4.0.18. I tried to reproduce in a new project but unable to reproduce it. I assume it's something that is found in the project but I am unable to locate and what makes it more strange is that I can rollback to v4.0.18 and it works as intended.
3 Replies
Zamion101
Zamion101OP3d ago
Dennis Koch
Dennis Koch3d ago
Please file issues on GitHub
Zamion101
Zamion101OP3d ago
GitHub
Regression in Repeater after v4.0.19 · Issue #18008 · filamen...
Package filament/filament Package Version v4.0.19 Laravel Version v12.31.1 Livewire Version v3.6.4 PHP Version PHP 8.4 Problem description After upgrading from v4.0.18 to v4.1.0 I have observed tha...

Did you find this page helpful?