FilamentF
Filament2y ago
Vp

select 'default' not working in filter action/forms

I am trying to filter dashboard widget using filter action/forms, I provide months options and try to set default to current month. Below is how I did
FilterAction::make()
    ->form([
        Forms\Components\Select::make('month')
            ->options([
                1 => 'January',
                2 => 'February',
                3 => 'March',
                4 => 'April',
                5 => 'May',
                ...
            ])
            ->default(now()->month)
            ->selectablePlaceholder(false),
    ]),

When page refresh, the select options always pointing to first item only instead of default
Solution
I think this is my chrome bug for that specific project.. I've restart the system and now it always pointing to 'October' 🤣
I check in firefox and it's working fine.. so I think there is no error
Was this page helpful?