Alphanumeric sorting initial sort
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
- Implement a new DataTable component. Adding columns, with one column using the 'alphanumeric' sort
- Have data that has integers in the values, like var1, var11, var103, var2, var22, var203 etc.
- On the DataTable component, set the
initialSortColumnto the column that has the 'alphanumeric' sort set - 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
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.
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 🙂
~~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
👋 @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.