Combining preloaded options and search results in Forms\Components\Select

Good day, everyone! I would like to improve user experience with choosing a client from a list in a resource form.

The current solution is based on getSearchResultsUsing. I do search in the DB when user enters a few chars. However, the delay for the search is a bit worse than I used to have in my old admin panel with React.

I would like to preload 50-100 most frequent clients in the Select to get instant search results, but I still need to append the Select list with the other not so frequent clients I found in the DB when the user types something in the input.

Can you please give me the direction to solve this. Would appreciate it!
Solution
If your problem is the delay for the search from the FRONT-END, it is called by the default debounce parameter of 1 second, to avoid sending multiple server requests each time user types something.

You can lower that debounce to almost 0, but keep in mind then with every typed character you may send an unnecessary server request

Docs: https://filamentphp.com/docs/3.x/forms/fields/select#tweaking-the-search-debounce
Was this page helpful?