Skip to content

[datatable-sort] Sort order inconsistent when comparing on equal value #1738

@gerardkcohen

Description

@gerardkcohen

When sorting a column that has multiple instances of the same value, toggling sort will not always return the same sort order.

Ex: http://jsbin.com/zuluquba/

In the above example, toggling sort on the amount column return's inconsistent row ordering. Notice the id order of the amount column when ascending/ descending is not always the same. As far as I can tell this only happens in Chrome (Im on a Mac).

This could possibly be an accessibility issue for users with cognitive disabilities. It is also very noticeable if you have a selection column (checkbox) and the item you have selected does not always appear in the same location on every sort.

Those might be minor issues, but the major issue is with pagination.

Ex: http://jsbin.com/wogayiku

In this example, when sorting the amount column in descending order you will find the same 2 id's at the bottom of the first page, and again at the bottom of the second page. This means 2 items are not being shown, or can be perceived as data missing. Of course, showing all items will display the complete set. I am currently seeing this on my Mac with Chrome, Firefox, and Safari.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions