© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
3 replies
Arjen

Setting searchable select field to null not working

I've got the following fields where the first field sets other select fields to null if the selected option gets changed.
Forms\Components\Select::make('sender_id')
    ->label(__('Sender ID'))
    ->options(BrevoSenders::pluck('name', 'id'))
    ->searchable()
    ->reactive()
    ->afterStateUpdated(function (\Closure $set) {
        $set("email.welcome.template_id", null);
    }),
Forms\Components\Select::make("email.welcome.template_id")
      ->label('Template ID')
      ->options(fn (\Closure $get) => !empty($get('sender_id')) ? BrevoTemplates::where('sender', $get('sender_id'))->pluck('name', 'id') : [])
      ->searchable()
      ->columnSpan('full'),
Forms\Components\Select::make('sender_id')
    ->label(__('Sender ID'))
    ->options(BrevoSenders::pluck('name', 'id'))
    ->searchable()
    ->reactive()
    ->afterStateUpdated(function (\Closure $set) {
        $set("email.welcome.template_id", null);
    }),
Forms\Components\Select::make("email.welcome.template_id")
      ->label('Template ID')
      ->options(fn (\Closure $get) => !empty($get('sender_id')) ? BrevoTemplates::where('sender', $get('sender_id'))->pluck('name', 'id') : [])
      ->searchable()
      ->columnSpan('full'),

The last field doesn't get set to null correctly if I change the first select. As you can see in the screenshot, it still contains the old value. However, when I remove
searchable
searchable
from the last field, it works correctly.
Any idea what's going on? Am I missing a piece of code?
image.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Select field not working
FilamentFFilament / ❓┊help
2y ago
Select disableOptionWhen() not working when using searchable()
FilamentFFilament / ❓┊help
3y ago
Select searchable
FilamentFFilament / ❓┊help
2y ago
Searchable Not Working
FilamentFFilament / ❓┊help
3y ago