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
Describe the bug
SimpleTableManual's sorting is reversed in Firefox when orderedBy is empty, or a non-existing column.
As a result, in 'editable' mode, where orderedBy is always an empty string, sorting is always reversed (in Firefox).
The rows being reversed also causes row-actions (such as Delete or Edit) to be applied to the incorrect row (because these send the client-index to the server, while the server's rows aren't reversed.
The cause of this issue:
Chrome and Firefox use a different underlying sorting algorithm. As an example, this snippet:
[1,2].sort((a,b)=>-1)
returns [2, 1] in Chrome, but [1, 2] in Firefox.
SimpleTableManual uses the following comparator function:
When a[orderedBy] and b[orderedBy] are both falsy (false, 0, null, undefined or ""), this function will return -1, which causes the firefox results to come out in reversed order.
Thanks @tumms2021389. Could you please also make the fix available in 24.1.x? Asking since we're not able to upgrade to 24.2.x before our go-live.
(working in same project as @wimbarelds)
Describe the bug
SimpleTableManual's sorting is reversed in Firefox when
orderedBy
is empty, or a non-existing column.As a result, in 'editable' mode, where
orderedBy
is always an empty string, sorting is always reversed (in Firefox).The rows being reversed also causes row-actions (such as Delete or Edit) to be applied to the incorrect row (because these send the client-index to the server, while the server's rows aren't reversed.
The cause of this issue:
Chrome and Firefox use a different underlying sorting algorithm. As an example, this snippet:
returns
[2, 1]
in Chrome, but[1, 2]
in Firefox.SimpleTableManual uses the following comparator function:
When
a[orderedBy]
andb[orderedBy]
are both falsy (false, 0, null, undefined or ""), this function will return-1
, which causes the firefox results to come out in reversed order.A fixed version of this function would be
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Desktop:
The text was updated successfully, but these errors were encountered: