react icon indicating copy to clipboard operation
react copied to clipboard

Alphanumeric sorting initial sort

Open ptasker opened this issue 2 years ago • 6 comments

Description

We're using the DataTable component and have a column that is using the 'alphanumeric' sort. Clicking the column header sorts the table correctly. Howver, on load, we have set this column as the initialSortColumn and the table is not initially sorted using the 'alphanumeric' sort, but using the 'basic' algo.

Steps to reproduce

  1. Implement a new DataTable component. Adding columns, with one column using the 'alphanumeric' sort
  2. Have data that has integers in the values, like var1, var11, var103, var2, var22, var203 etc.
  3. On the DataTable component, set the initialSortColumn to the column that has the 'alphanumeric' sort set
  4. On load the table will be sorted using a 'basic' algo. Clicking on the table column header will make it sort using the alphanumeric algo.

Version

latest

Browser

No response

ptasker avatar Nov 17 '23 18:11 ptasker

Thanks for filing this bug!

@joshblack could you provide an estimate of size for this and we'll see if we can prioritize? I'm wondering if we might be able to fit this into an upcoming FR cycle for a PRC engineer.

lesliecdubs avatar Nov 20 '23 20:11 lesliecdubs

Hi 👋 I hope I'm not treading on any toes here by opening a PR for this issue but, as I mentioned in the linked PR, I wanted to explore the code a bit and thought I'd grab an open issue as a starting point.

Thoughts and feedback on #3967 would be appreciated, thanks 🙂

joshfarrant avatar Nov 23 '23 16:11 joshfarrant

~~Hello! I was interested in contributing to Primer and I have a fix for this issue on a local branch. It seems like I might need permission to push a branch, because I received a 403 response when I tried. If this is user error, feel free to let me know and I'll look into it.~~

If you aren't interested in a contribution, no worries!

Update: I realized that I could open a PR by following the steps here: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork

bwittenberg avatar May 13 '24 13:05 bwittenberg

👋 @joshblack , I see you reviewed a previous PR related to this issue so I wanted to let you know that I attempted to fix with https://github.com/primer/react/pull/4602.

bwittenberg avatar May 22 '24 13:05 bwittenberg