disable select dropdown search from rerunning table query
@kapa.ai How can I keep the select dropdown search from rerunning the associated table query?
2 Replies
Hi @amvdxc. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To disable the select dropdown search from rerunning the associated table query, you can handle client-side filtering for the select dropdown. This way, the search input will not trigger a server-side query.
Here is how you can achieve this using the
useSelect
hook from refine with Mantine or Ant Design:
Mantine Example
You can disable server-side filtering by passing the onSearch
function as undefined
and managing the search input state on the client-side:
Ant Design Example
Similarly, for Ant Design, you can manage the search input state on the client-side:
By setting onSearch
to undefined
and managing the searchValue
and onSearchChange
properties, you ensure that the search input does not trigger a server-side query, thus keeping the select dropdown search from rerunning the associated table query.
For more information, you can refer to the Mantine useSelect
documentation (https://refine.dev/docs/ui-integrations/mantine/hooks/use-select/#onsearch) and the Ant Design useSelect
documentation (https://refine.dev/docs/ui-integrations/ant-design/hooks/use-select/#debounce).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@705425032960016475> kapa.ai is still learning and improving, please let us know how it did by reacting below