Material-table: Table flashes and delete words when searching in remote data table

Created on 26 Apr 2019  路  5Comments  路  Source: mbrn/material-table

Describe the bug
After implementing the remote data table as the example provided, if the user types on the search input, the table flashes for every word typed and sometimes if you type really fast, it will delete some of the words you typed, I would recommend to implement a debounce or throttling for the search input. Also and I know it's a already reported bug, but the filters state also reset #491 .

bug

Most helpful comment

Actually it has a debounce. It is default 200ms. You can change it with options.debounceInterval

All 5 comments

Hi @terapepo

This is not a bug. You used columns directly. I advise you to use them in parent components' state. So tableData of columns will not be disappear when you setState in data function.

Actually it has a debounce. It is default 200ms. You can change it with options.debounceInterval

Hi @terapepo

This is not a bug. You used columns directly. I advise you to use them in parent components' state. So tableData of columns will not be disappear when you setState in data function.

Hi @mbrn

How can i achieve it? Do i have to declare columns in the parent component?

<MaterialTable
        style={{ width:'100%'}}
        title={<Typography style={{ fontSize:'calc(10px + .5vw)' }}>Title</Typography>}
        columns={[
          { title: 'Id', field: 'id' },
          { title: 'Nome', field: 'name' },
          { title: 'E-mail', field: 'email' },
          { title: 'Role', field: 'roles[0]', sorting: false },
        ]}
        options={{ 
            search: true,
            debounceInterval:1000
          }}
        data={query => tableService.searchUsers(query)

        }/>

Thank You.

Hi @mbrn ,
do you have resolve?

When I try to update data, the values of filter disappears.

Thanks in advance.

debounceInterval:1000
It's not working.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

slevy85 picture slevy85  路  3Comments

ModPhoenix picture ModPhoenix  路  3Comments

balibou picture balibou  路  3Comments

jlgreene2 picture jlgreene2  路  3Comments

revskill10 picture revskill10  路  3Comments