Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultSortFieldId triggers client side sorting even when sortServer is on #805

Closed
5 tasks done
jisensee opened this issue May 14, 2021 · 1 comment · Fixed by #823
Closed
5 tasks done

defaultSortFieldId triggers client side sorting even when sortServer is on #805

jisensee opened this issue May 14, 2021 · 1 comment · Fixed by #823
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@jisensee
Copy link

jisensee commented May 14, 2021

Issue Check list

  • Agree to the Code of Conduct
  • Read the README
  • You are using React 16.8.0+
  • You installed styled-components
  • Include relevant code or preferably a code sandbox

Describe the bug

Using defaultSortFieldId with server side sorting still appears to trigger the build-in client side sorting.

To Reproduce

Create a server side sorting table and set defaultSortFieldId.
See that the selected column is not sorted like the data that is passed in, but sorted by the internal sorting.
Manually specifying a sortingFunction that simply copies the data fixes the issue.

Expected behavior

The internal sorting should never be triggered when sortServer is enabled.

Code Sandbox, Screenshots, or Relevant Code

https://codesandbox.io/s/react-data-table-sandbox-forked-754lb?file=/src/index.js
Runtime is sorted client side here even though sortServer is on.

Versions (please complete the following information)

See Codesandbox

@jbetancur jbetancur self-assigned this May 17, 2021
@jbetancur jbetancur added the bug Something isn't working label May 17, 2021
@jbetancur
Copy link
Owner

Thank you for logging this. I'll take a look at fixing this soon in version 7 and 8

@jbetancur jbetancur added this to To do in RDT Next 7 via automation May 17, 2021
@jbetancur jbetancur added this to the RDT Next milestone May 17, 2021
@jbetancur jbetancur moved this from To do to In progress in RDT Next 7 May 17, 2021
RDT Next 7 automation moved this from In progress to Done Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
RDT Next 7
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants