Repeater Event listener not working

I have tried to use the listener as described in the documentation, but it does not work. The repeater is inserted in a tab. Is there anything to consider here?

use Filament\Forms\Components\Component;

protected function setUp(): void
{
parent::setUp();

$this->registerListeners([
'repeater::createItem' => [
function (Component $component, string $statePath): void {
if ($component->isDisabled()) {
return;
}

if ($statePath !== $component->getStatePath()) {
return;
}

// ...
},
],
]);
}
Was this page helpful?