We have a table that uses selectable rows. When a user searches, the value is used to filter down the data for the table and display the filtered results.
This all works as expected. The issue relates to selected rows. We use a callback as described in docs for the selected rows.
What happens is the onSelectedRowsChange function is called when search is submitted/data changes and causes an empty selectedRows attribute.
We see the search as being a data filter, not an entire new set of data. Therefore if you select a row, then search for data where the initial selection is not within, you loose the initial selection. I'd expect the same selection to be held in state whilst a filter is taking place (search). Otherwise if the search term is removed, so is your original selection.
Issue Check list
styled-components
Describe the bug
We have a table that uses selectable rows. When a user searches, the value is used to filter down the data for the table and display the filtered results. This all works as expected. The issue relates to selected rows. We use a callback as described in docs for the selected rows.
What happens is the
onSelectedRowsChange
function is called when search is submitted/data changes and causes an empty selectedRows attribute.We see the search as being a data filter, not an entire new set of data. Therefore if you select a row, then search for data where the initial selection is not within, you loose the initial selection. I'd expect the same selection to be held in state whilst a filter is taking place (search). Otherwise if the search term is removed, so is your original selection.