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

Datagrid Custom sorting does not reset the sort order on refresh of rowdata #6043

Open
2 tasks done
marinamas opened this issue Sep 11, 2024 · 1 comment
Open
2 tasks done

Comments

@marinamas
Copy link

Package

Carbon for IBM Products

Description

  • When user is trying to refresh , the sort order also needs to be refreshed unless autoResetSortBy: false

  • This happens when is trying to use the custom sort logic as shown in the code sandbox example

Component(s) impacted

Datagrid sorting

Browser

Chrome, Safari, Firefox, Microsoft Edge

@carbon/ibm-products (previously @carbon/ibm-cloud-cognitive) version

"@carbon/ibm-products": "2.48.0",

Suggested Severity

Severity 2 = Aspects of design is broken, and impedes users in a significant way, but there is a way to complete their tasks. Affects major functionality, has a workaround.

Product/offering

NA

CodeSandbox or Stackblitz example

https://codesandbox.io/p/sandbox/datagrid-tooltip-hover-issue-26hqww?file=%2Fsrc%2FExample.js%3A109%2C46

Steps to reproduce the issue (if applicable)

Even though user has a custom logic for onSort written . On refresh of table the sort direction needs to be reset

Screen.Recording.2024-09-11.at.11.16.23.PM.mov

Release date (if applicable)

No response

Code of Conduct

@amal-k-joy
Copy link
Contributor

Hey @marinamas ,
Can you check if you could achieve this by reseting the sort yourself on refresh functionality.

useEffect(() => {
    datagridState.setSortBy([]);
  }, [data]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs triage 🧐
Development

No branches or pull requests

3 participants