Skip to content

Sorting direction not updating properly with manual sorting and same values on current page #5147

Description

@jenmak-tangelo

Describe the bug

When the data in the table column is all the same value (an empty string), the header.column.getIsSorted() function goes from ascending to false and never reaches descending.

Your minimal, reproducible example

Do not have

Steps to reproduce

Sort by a column with data that has empty values.
See that the empty values are shown first with ascending sorting.
Try to click again (execute header.column.getToggleSortingHandler())
And see that the sorting direction changes from ascending to false.

Expected behavior

The sorting direction should be changing to descending, instead of returning to false.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

macOS

react-table version

8.10.3

TypeScript version

5.1.6

Additional context

No response

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

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