Material-table: The search feature should wait for user to stop typing

Created on 24 Jul 2019  路  2Comments  路  Source: mbrn/material-table

When I implement the search box with remote data. It is always jerky when I type the text. Because It always make the update the search text and do a query to get data when I type.

Solution to fix this issue is make the timeout to wait for user to stop typing at least 500 milliseconds. So the search will be called after user stop typing 500 ms.

Actually we will have options to user set the time if they want to custom:

options: {
  ..
  search: true,
  searchProps: {
    waitForTyping: 500
  },
 ..
}

Most helpful comment

Check out debounceInterval under Options in the docs - the default is 200ms.

Should be able to do something like:

<MaterialTable
    ...
    options={{
        ...
        debounceInterval: 500,
        ...
    }}
    ...
/>

All 2 comments

Check out debounceInterval under Options in the docs - the default is 200ms.

Should be able to do something like:

<MaterialTable
    ...
    options={{
        ...
        debounceInterval: 500,
        ...
    }}
    ...
/>

@oze4 Thanks so much. I read the docs but I missed it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

slevy85 picture slevy85  路  3Comments

Mihier-Roy picture Mihier-Roy  路  3Comments

diegosps picture diegosps  路  3Comments

ModPhoenix picture ModPhoenix  路  3Comments

behrouz-s picture behrouz-s  路  3Comments