F
Filament11mo ago
Igor

Conditional Select options don`t work if disabled field

Hi guys, seems a bug to me. I'm trying enable and add options dynamically in a select after another select changes, but if I add the disabled option in the second select, it not add any option, if I remove it, works like a charm
Select::make('cliente_id') ->relationship('cliente', 'nome') ->searchable() ->live(onBlur: true) ->required(), Select::make('veiculo_cliente') ->required() ->disabled(fn (Get $get): bool => ! $get('cliente_id')) ->native(false) ->allowHtml() ->options(function (Get $get) { $id = $get('cliente_id'); if (!$id) { return []; } return Cliente::find($id)->veiculos->map( function (array $veiculo) { return view('veiculoSelectItem',$veiculo)->render(); })->toArray(); })
1 Reply
Kenneth Sese
Kenneth Sese11mo ago
This is an issue with Choices.js unfortunately. After it's been disabled, it can't initialize again. https://github.com/filamentphp/filament/issues/3068
GitHub
Disabled on select in repeater not reactive · Issue #3068 · filamen...
Package filament/forms Package Version v2.13.24 Laravel Version 9.11 Livewire Version No response PHP Version 8.0.2 Bug description With the following form schema when i try to change the disabled ...
Want results from more Discord servers?
Add your server