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

Sort logic and SORT_TYPES.None question #889

Open
1 task done
plweil opened this issue Oct 8, 2021 · 1 comment
Open
1 task done

Sort logic and SORT_TYPES.None question #889

plweil opened this issue Oct 8, 2021 · 1 comment

Comments

@plweil
Copy link
Contributor

plweil commented Oct 8, 2021

Issue Type

Expected Behavior

Assume this is not multi-column sorting.
I would expect that clicking the sort button in a previously unsorted column A would sort the table by column A ascending.

Next, clicking Column A (sorted ascending) would sort the table by Column A descending.

Clicking the button subsequently would alternate between ascending and descending.

Sorting the table by a different column would leave Column A unsorted.

Actual Behavior

Instead, the third click sets the column sort type to none". What is "none", and what does it do? The only thing that should turn sorting off for a column that has been sorted is to sort by a different column.

I don't understand the logic of applying SORT_TYPES.None to a column that has been clicked three times. This has major ramifications for the sort icon, the use of aria-sort on headings, and the sort button name.

@xaksis
Copy link
Owner

xaksis commented Oct 15, 2021

The reason for the 3rd mode for sorting is to reset the table to its original order. Otherwise, there is no way to get back to the original state once any sort is performed.
Relevant ticket: #794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants