list.js
list.js copied to clipboard
data-default-order not working?
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.

Looks like only the doc change, but not the implementation has been merged to master. See #301.
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