Customize table default search debounce behavior
I am currently using a filament table search at one of the main pages of the website. If the users enters a letter, the search will be triggered immediately which creates some db load.
How could I customize the default search to require a minimum of letters to be entered, search only when leaving the field or on enter, debounce timing and so on. I was able to do this with a custom form in a TextInput on getTableFilters with min() and lazy() but not with the default search field. Any recommendations how to do this?
5 Replies
I think all you can do is return a DB query that doesn't query any results (like
1 = 0
) if the search is shorter than X letters.Nice idea.. should have thought of it myself, Any Ideas about the lazy/debounce behavior too?
It's probably not supported.
Hmm, I could start customizing filament\vendor\filament\tables\resources\views\components\search-input.blade.php and so on creating a MR, would that be something that would work or even be appreciated?
I guess it would be useful, but I am not sure about a good syntax