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

fix: column default_sort_order respected when resorting #26

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

machow
Copy link
Owner

@machow machow commented Nov 21, 2024

addresses #25 by adding a Column.default_sort_desc property. This means that...

  • The Props (Table data) class still handles setting the initial sort order for columns.
  • Columns now have the data to say what to do when a column is unsorted, and then sort is clicked.
    • e.g. Column A set to default to ascending order, AND it is initially sorted. If a person clicks Column B, it unsets the Column A sorting. Then, when they click Column A again, it should use the specified default and first do ascending.

Here's a demo of the fix using https://pr-26--react-tables-preview.netlify.app/get-started/controls-sorting#default-sort-order

Initial

image

click sort by year

image

click sort by species

image

@machow machow merged commit a051023 into main Nov 21, 2024
6 checks passed
@machow machow deleted the fix-column-later-desc-sort branch November 21, 2024 21:09
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

Successfully merging this pull request may close these issues.

1 participant