primer / react

An implementation of GitHub's Primer Design System using React
https://primer.style/guides/react
MIT License
3.15k stars 536 forks source link

Alphanumeric sorting initial sort #3951

Open ptasker opened 11 months ago

ptasker commented 11 months ago

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

lesliecdubs commented 11 months ago

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.

joshfarrant commented 11 months ago

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 🙂

bwittenberg commented 6 months ago

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 commented 5 months ago

👋 @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.

lesliecdubs commented 2 months ago

Hi there, thanks so much for your patience 🙏 I see @TylerJDev was tagged as reviewer on https://github.com/primer/react/pull/4602. We'll be follow up soon! Please feel free to nudge us again here if we haven't gotten back to you by next week.

bwittenberg commented 2 months ago

Thanks @lesliecdubs !