-
Notifications
You must be signed in to change notification settings - Fork 841
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
Make table sorting deterministic #860
Comments
Two items to address here:
Fixing 1 solves this issue in the table docs and should introduce row stability in most cases. However, the ES spec does not specify anything about I think secondary/multiple sort-by columns is an intriguing idea but it carries additional design work to properly implement, so I am not addressing that in this issue. Feel free to raise a new issue for that discussion if that's desired functionality! Further, if we think true stable sort is something that we want for these tables we will need to add one of the many such JS user-space sort implementations. For now I am going ahead with the simple fix of avoiding mutation the input |
In the example below, you can see that changing the pagination results in the order of the rows changing:
This is because the table is sorted on
dateOfBirth
, but they all possess the same birth dates.One solution could be to allow the user to specify a secondary property to sort on. As long as the secondary properties are not also identical, this will result in matching items being sorted deterministically. If the user doesn't provide a secondary sort property, then we could fall back to sorting on the
itemId
, if it's provided.The text was updated successfully, but these errors were encountered: