Skip to content

Commit

Permalink
Fix: descending button always toggled ascend if sort order was undefi…
Browse files Browse the repository at this point in the history
…ned.
  • Loading branch information
Scooter1337 committed Mar 21, 2024
1 parent 9a9d484 commit 2c7dc3f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
if (props.sort.order === "desc") {
return;
}
props.sort.toggle(e);
if (props.sort.order === undefined) {
// We can only toggle, so we toggle from undefined to 'asc' first
props.sort.toggle(e);
}
props.sort.toggle(e); // Then we toggle from 'asc' to 'desc'
}
function handleHide() {
Expand Down

0 comments on commit 2c7dc3f

Please sign in to comment.