infinite-table / infinite-react

The modern React DataGrid for building apps — faster
https://infinite-table.com
73 stars 5 forks source link

Extra data source events triggered #29

Closed vitolpoc closed 2 years ago

vitolpoc commented 2 years ago

Version: 0.0.10

Starting from the pagination documentation sandbox , here is a sandbox to illustrate the issue: https://codesandbox.io/s/events-for-sorting-and-pagination-ypyee?file=/src/App.tsx

When using sort & pagination at the same time, we have extra events which triggers fetching several times the same data.

When sorting, the onDataParamsChange is triggered with the current livePaginationCursor (which should be 0 instead) and it's called twice. image

Also, this leads to another issue depending on the number of page that can be displayed. In the following screenshot, when sorting on country, it has not requested the next pages (and does not display the vertical scrollbar): image

vitolpoc commented 2 years ago

Also opened a more general discussion about the events here: https://github.com/infinite-table/infinite-react/discussions/30