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
When page refresh, the select options always pointing to first item only instead of
default
Solution:Jump to 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...
10 Replies
When page refreshes..?
Isn't it setting 4 to the Select as default?
No, always set to 1 (January) in default, when page refresh means when I change options to 'Jan', 'Feb' etc it display correct data but after refresh it set to 1 (Jan) only
Weird.. Filament version?
Now
v3.2.50
let me try to update and check againUpdated to
v3.2.63
and still the sameI've created a new project and the same code is working fine.. what should be the error in my existing one.....
hum ok
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
Bumping this again because there is weird things happening again..
dd(now()->month)
inside dashboard gives me 4
but dd($this->filters['month']);
inside widgets getStats()
gives me "3"
so It filter "March" data only, not April (current month)I just ran into the same problem, Filament keeps track of the latest selected value inside a session/cookie called Dashboard_filters, after a refresh it will use that value to set the default. Try removing your cookies and see what default value is used, most likely it will use April 🤞