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

4 messages · Page 1 of 1 (latest)

fair ether
#

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

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;
  });
})

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.

undone ingotBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

fair ether
old breach
#

Please file issues on GitHub