Repeater limitation
I'm having an issue while adding a new feature to the
repeater
. I want to limit the delete functionality, since I don't need to delete the first repeater item but I do need to delete the others.
I tried setting it up with deletable
as mentioned in the documentation, but I couldn't achieve the desired result, because it takes the repeater
in a general way
This is my code:

3 Replies
Up
Maybe something like this?
->deleteAction(function (Action $action) {
$action->visible(function (array $arguments, Repeater $component): bool {
$itemKey = $arguments['item'];
$keys = array_keys($component->getState() ?? []);
$first = $keys[0] ?? null;
return $itemKey !== $first;
});
})
I've used item and it worked... thanks π π