Skip to content
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

data-default-order not working? #717

Open
DannyJoris opened this issue Feb 2, 2021 · 2 comments
Open

data-default-order not working? #717

DannyJoris opened this issue Feb 2, 2021 · 2 comments

Comments

@DannyJoris
Copy link

DannyJoris commented Feb 2, 2021

I'm either not understanding how data-default-order is supposed to work, or it's not working at all.

The docs: https://listjs.com/docs/search-sort/

Here's an example: https://codepen.io/DannyJoris/pen/PobqXjQ

<th class="sort" data-sort="name" data-default-order="asc">Name</th>
<th class="sort" data-sort="age" data-default-order="desc">Age</th>
<th class="sort" data-sort="city" data-default-order="asc">City</th>

When I click "Age" for the first time, I would expect the list to sort in descending (large to small) order, but this is ignored and just sorts in ascending order. The following toggles all work, but it's the initial sort that doesn't match with what I'm expecting.

Screen Shot 2021-02-02 at 4 17 46 PM

@markus-ksg
Copy link

Looks like only the doc change, but not the implementation has been merged to master. See #301.

@iamrobert
Copy link

I believe I have updated it for the latest version 2.3 to work:
https://github.com/iamrobert/list.js/blob/patch-1/src/sort.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants