Autodesk / Autodesk/react-base-table

Change the default sort direction to DESC on first click on each column header

Open
#290 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
170
PR merge metrics
No merged PRs in 30d

Description

Hello, currently if you click on random column header you get results sorted ASC and then DESC, and etc. The toggle ASC/DESC is correct but it always starts with ASC. I need this to start with DESC: when you click on any column header I need first sort direction to be DESC. Here is a basic playground:

https://autodesk.github.io/react-base-table/playground#MYGwhgzhAEBOCmZgBcBCl4BUwCMTwFEAPMAWwAd9p4jl4A7AExgCVEUA6AYQHsKf6DZNADeAKGjQJwARGSwArih6wAFOVg9yEAJSiJk6BAXl4ajVt0BuA5PzCZIBaXowAvNGQALAJYQOAPoA5vDIAMoqyDhg+LxOLhCqOjaG0PbQjGDIYNAeIYKwWfAAIllgqo7OrgA00ABMAAxNOhwIAG5mEPBJNraevv5yRbn6qZIQkagAngBco2OSANbws9AA5JUuALQNa9V9qSqMZnNrxxDAawfQAL77C5uuc48Q92OZ2XMfYH03KbcGAzBUIRWBRGLwOJVdzQJK5AB88zsoWgLxG+TMRShCVUAEYGsk+gAzFSw9I+EYNKzQCkAHlRPHirg4+HoQW81J8AGouXpxA9GdCANo+AC6HAmYNwVA88gU8H+khufQQyAUsHoDKZEH+yoMAmx9FBwg8krQUwRSP6fglIOydFU-LGZumb1S3zm3htQzoHG+rXgHVgXSSv0JSt6kgQTDMcKdUdC6s1qlpjB8bXhfVpXlx8ON8EY0BwFtpOHhIi9g3t8AlkymHGWUxutIA9GWMj4ECgfAJoKXy5WJdXa2DphwjmZm234a2c5nUrTsHh4NciT4iAXri83BWBkOihwXsqFt8d4OfTXvsfnXWz3uLyPzdfDvRDca7zaDYKXMbn9AWzOLZphm4YAsqNDkJEGTwESYAKCAwgIEgaAYEu+DEGQlAKkAA

How can I instruct react-base-table to change first click to DESC?

Contributor guide

Open the contributing guide

Research direction

Start with the linked react-base-table playground and reproduce sorting by clicking a column header. Trace the column-header sort behavior to find where the initial direction is selected; done means the first click sorts DESC while later clicks continue toggling ASC/DESC.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.