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

[FEATURE]: Disable sort/restore initial state

Open AXeL-dev opened this issue 3 years ago • 3 comments

Feature Check list

  • [x] Agree to the Code of Conduct
  • [x] Read the README to ensure the feature is not already present
  • [x] You read Creating Issues, Features and Pull Requests
  • [x] Considered the value versus complexity for all users of the library as well as library maintenance
  • [x] Considered if this can be a storybook or documentation example

Is your feature request related to a problem? Please describe

I just noticed that there is no way to cancel sorting & restore the original/initial state.

Describe the solution you'd like

Asc & desc sort icons to be deactivated when we click on them?

Describe alternatives you've considered

Since first user click sorts by asc direction & the 2nd sorts by desc, maybe just cancel sort on the third click?

Example: https://github.com/AXeL-dev/react-data-table-component/commit/1e0217c1604757169e81a651b7c4eafb06ff4165

AXeL-dev avatar Jul 05 '21 00:07 AXeL-dev

Yea, I've actually thought about adding the ability to "reset" the sort on the 3rd click. My only hesitation was that UX-wise there does not seem to be a consensus on what the best behavior is? Some libraries do and some don't. In any case, I'll add this as a feature to v7.

jbetancur avatar Jul 07 '21 19:07 jbetancur

Yea, I've actually thought about adding the ability to "reset" the sort on the 3rd click. My only hesitation was that UX-wise there does not seem to be a consensus on what the best behavior is?

Indeed, from a UX view using a third click might not be the best solution, one other possibility is to have both asc & desc icons which can be toggled/disabled on icon click, as below:

image

AXeL-dev avatar Jul 07 '21 23:07 AXeL-dev

Yes, I'm absolutely agree that's the missing feature. Looking forward to see this one to be applied into the library.

Mangor1no avatar Aug 13 '21 11:08 Mangor1no