You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking we could add __position property to elements we receive in the data property, and use that property to make sorting stable.
But I'm wondering if it is generally accepted for a public component to alter data that is passed to it.
Description
Sorting items in an omnitable is not stable according to this definition https://en.wikipedia.org/wiki/Sorting_algorithm#Stability
First, on chrome, when sorting on a column for the first time with no grouping, the original items order is not preserved.
This is not a Chrome bug, since array sort does not have to be stable https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.sort
Also, since we sort the items array in place, sorting on column
c1
, thenc2
, thenc1
again will produce a different output.Steps to reproduce
c1
c1
valuec2
c1
againc1
valueAdditionally, you can compare sort stability on different browser using:
Expected results
Sorting should be stable, i.e. elements that compare equal when sorting should have their original order in the
data
array passed to the omnitableThe text was updated successfully, but these errors were encountered: