F
Filament16mo ago
justgkp

Dynamic fields based on a select option won't working adding extra Grid or Section

I was trying to add an extra Grid inside select option. It is not working as expected. Without Grid or Section it's working. Please fix it. Grid::make(2) ->schema(fn (Get $get): array => match ($get('type')) { 'employee' => [ //NOT RESPONDING AFTER ADDING AN EXTRA GRID Grid::make() ->schema([ TextInput::make('employee_number') ->required(), FileUpload::make('badge') ->image() ->required(), ]), //IF I ADD A GRID OR SECTION AFTER THE FIRST COMPONENT, ITS WORKING.... Grid::make() ->schema([ TextInput::make('employee_number') ->required(), FileUpload::make('badge') ->image() ->required(), ]), ], 'freelancer' => [ TextInput::make('hourly_rate') ->numeric() ->required() ->prefix('€'), FileUpload::make('contract') ->required(), ], default => [], }) ->key('dynamicTypeFields')
2 Replies
cheesegrits
cheesegrits16mo ago
Could you format your code with the php tag and back ticks, as per #✅┊rules, it's impossible to read otherwise.
Dennis Koch
Dennis Koch16mo ago
Please fix it
This is not the place for bug reports. If you think this is a bug please open an issue on GitHub
Want results from more Discord servers?
Add your server