Description
Package
filament/filament
Package Version
v3.2.124
Laravel Version
v11.0
Livewire Version
No response
PHP Version
PHP 8.3.0
Problem description
When using custom form filters in tables, live()
fields bypass the deferFilters()
setting, causing the query to rerun immediately after the field is modified.
This issue seems to occur because the deferFilters()
mechanism relies on the live()
property, as seen in the following filament code:
Line 36 of filament/tables/src/Concerns/HasFilters.php
->when(! $this->getTable()->hasDeferredFilters(), fn (Form $form) => $form->live());
Expected behavior
I expect deferFilters() to be independent of the content of my filter form. For example, I'm using dynamic type properties in my filter form (https://filamentphp.com/docs/3.x/forms/advanced#dynamic-fields-based-on-a-select-option), and live() property is very much needed (if you know a workaround to make it working without live(), please share).
Steps to reproduce
- Use a filter form in a table with a field that has live() setting.
- Enable deferFilters() option
- Check that modifying the said field triggers query update, even if it should wait apply button action.
Reproduction repository (issue will be closed if this is not valid)
https://github.com/davide-alpi/filament-issue-defer-filters
Relevant log output
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo