'name' gone in Select multiple() after getSearchResultsUsing()

Hi everyone, I'm using Filament Admin and I have the error presented in the video. Apparently, every time a search is done, the selected options are cleared. I've searched and found a similar problem like mine here: https://github.com/filamentphp/filament/discussions/3079, where Ryang says that 'wire:ignore' or 'wire:ignore.self' need to be added to prevent the Alpine component being reinitialized, but I couldn't make it work through a
->extraAttributes()
->extraAttributes()
in the Select Component. This is my code:
Select::make('ListasCategorias')
->multiple()
->searchable()
->label('Categorias')
->getSearchResultsUsing(fn (string $search) => Categoria::where('descripcion', 'like', "%{$search}%")->limit(20)->pluck('descripcion', 'cod_categoria'))
->getOptionLabelUsing(fn ($value): ?string => Categoria::find($value)?->descripcion),
Select::make('ListasCategorias')
->multiple()
->searchable()
->label('Categorias')
->getSearchResultsUsing(fn (string $search) => Categoria::where('descripcion', 'like', "%{$search}%")->limit(20)->pluck('descripcion', 'cod_categoria'))
->getOptionLabelUsing(fn ($value): ?string => Categoria::find($value)?->descripcion),

The
->getOptionLabelUsing()
->getOptionLabelUsing()
for some reason is not working, any help would be appreciated it!
GitHub
Repeated Custom Field Loses Input · filamentphp filament · Discussi...
I made a custom field for file uploads via Uploadcare.com It seems to work well, but whenever I add a new field inside a Repeater (That is part of a Builder), the existing fields lose their input v...
2 Replies
Dan Harrin
Dan Harrin15mo ago
fortunately this is not a problem with filament Replace getOptionLabelUsing() with ->getOptionLabelsUsing(fn ($values): array => Categoria::find($values)?->pluck('descripcion', 'cod_categoria'))
Franco Miranda
Franco Miranda15mo ago
Thank you so much Dan, It worked !