FilamentF
Filament3y ago
Abi

How to show/hide fields inside a repeater with a reactive field in a repeater?

I am using the Standalone Form Builder.
I have to show and hide a TextInput within a repeater based on the value selected on a Select element inside the repeater.

Here is what I have
 Repeater::make('items')
      ->label('Items')
      ->schema([
          Select::make('item')->label('What item on this tracking number are you claiming?')->options([
              'item1' => 'Item 1',
              'item2' => 'Item 2',
              'item3' => 'Item 3',
          ])->reactive(),
          Radio::make('claim_type')
              ->label('Claim Type')
              ->inline()
              ->options([
                  'damage' => 'Damage',
                  'lost' => 'Lost',
                  'stolen' => 'Stolen',
              ])->visible(?),

I am not sure what actually goes inside the visible method. I am assuming there is a way to get the current item index on the repeater and check for the value. Any advice?
Was this page helpful?