InteractsWithPageFilters doesn't refresh the Widget on filter change
My Dashboard.php and my Widget is all set up correctly to use the new v3.1.0 dashboard filter function. In my widget file with DebugBar I can see that $this->filters change correctly, but for some reason the widget itself doesn't refresh. Once I refresh the full page, it displays the correct filtered data.
The docs say: "When the filters are updated, the widgets will be reloaded with the new data."
I believe there is a bug with this part.
7 Replies
protected static ?string $pollingInterval = '10s';
Using this in the widget, after changing the filter and the 10s is done, it updates with the correct filtered data, but if it is set to 'null' it won't update the chart, only after a refresh
Ahh found the issue, this only updates BaseWidgets, not ChartWidgets
Note: they're looking for someone to open an Issue with working code example to use for fixing it: https://github.com/filamentphp/filament/pull/9747#issuecomment-1832777643
Yes ty, it was me:)
I'm just really busy this week
The same thing happens to me with ChartWidget
GitHub
Releases · filamentphp/filament
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
Don't mean to hijack this thread but I'm running into a similar issue. I'm using v3.1.42 and when I select a date from a date picker in the default dashboard header actions, the value operates as normal for a classic filament widget located in the widgets folder. But when I break that widget out into a livewire component and pass $this->filters to the component, the picked date does not update until I hard refresh the page.
Any ideas what I'm missing or might be doing wrong?
In case anyone else comes across this, a livewire component was desired and all that was needed was the #[Reactive] property to be added to the public variable declaration in the component based on the property that is passed into the component. Little bit of livewire documentation for further context.
https://livewire.laravel.com/docs/nesting#reactive-props
Laravel
Nesting Components | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.