performance in forms
I have a ton of fields for a page builder, and I'm running into regular issues waiting to input into fields or for live ones to populate. Would using modal actions help?
5 Replies
@Leandro Ferreira I've just tried that, and same issue, it's things like this that I'd like to move over
Section::make('Margin')
->collapsed()
->schema([
Select::make('cta_margin')
->label('Margin')
->multiple()
->live(onBlur: true)
->afterStateUpdated(fn(Select $component) => $component
->getContainer()
->getComponent('cta_margin_fields')
->getChildComponentContainer()
->fill())
->options([
'top' => 'Top',
'bottom' => 'Bottom',
'left' => 'Left',
'right' => 'Right',
'all' => 'All Sides',
]),
Grid::make(2)
->schema(function (Get $get): array {
$positions = (array)$get('cta_margin');
$input_fields = [];
foreach ($positions as $position) {
$input_fields[] = TextInput::make("ctamargin{$position}");
}
return $input_fields;
})
->key('cta_margin_fields'),
]);
I don't think there is much you can do on large builder forms
admin
I have moved what I can to extraitemactions and simplified, seems to have helped