react-data-table-component icon indicating copy to clipboard operation
react-data-table-component copied to clipboard

defaultSortAsc and defaultSortFieldId is not changed sometimes

Open andy-yu-y opened this issue 3 years ago • 1 comments

defaultSortAsc and defaultSortFieldId work differently as paginationDefaultPage. when path is changed, i use use-effect to refetch the table data, but defaultSortAsc and defaultSortFieldId wont changed under this condition, in the meanwhile paginationDefaultPage works fine.

I think there is bug about this, defaultSortAsc and defaultSortFieldId only works when user refresh the page. For paginationDefaultPage, it take effect when table data fetched everytime. Below is the code for your reference: <DataTable title={title} theme={window.THEME.palette.type} ........... paginationDefaultPage={pageRef.current} paginationPerPage={pageSizeRef.current} paginationRowsPerPageOptions={rowsPerPage} paginationComponentOptions={{ rowsPerPageText: 'Shows per page:', rangeSeparatorText: 'out of', }} ......... sortServer onSort={handleSort} defaultSortAsc={sortIndicatorRef.current} defaultSortField={sortByRef.current} sortIcon={<ArrowDownward />} />

andy-yu-y avatar Sep 07 '22 08:09 andy-yu-y

Found one history issue related to this: https://github.com/jbetancur/react-data-table-component/pull/590

andy-yu-y avatar Sep 09 '22 02:09 andy-yu-y

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 12 '22 18:11 stale[bot]

issue still there

andy-yu-y avatar Nov 15 '22 02:11 andy-yu-y