bito-code-review[bot] commented on PR #42136:
URL: https://github.com/apache/superset/pull/42136#issuecomment-5003596299
<!-- Bito Reply -->
The flagged issue is correct. Hardcoding `autoResetPage: false` prevents the
table from resetting to the first page when the dataset shrinks due to
filtering, leading to an out-of-range page index and an empty table body. To
resolve this, you should make the `autoResetPage` condition dynamic, similar to
how `autoResetGlobalFilter` and `autoResetSortBy` are handled, by checking if
the column names have changed or if the dataset has been filtered.
Here is the suggested fix for
`superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx`:
```tsx
autoResetGlobalFilter: !isEqual(columnNames, previousColumnNames),
autoResetSortBy: !isEqual(columnNames, previousColumnNames),
autoResetPage: !isEqual(columnNames, previousColumnNames),
manualSortBy: !!serverPagination,
```
I have checked the available PR comments, and there are no other review
comments to address. Would you like me to perform any further analysis?
**superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx**
```
autoResetGlobalFilter: !isEqual(columnNames, previousColumnNames),
autoResetSortBy: !isEqual(columnNames, previousColumnNames),
autoResetPage: !isEqual(columnNames, previousColumnNames),
manualSortBy: !!serverPagination,
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]