datasette icon indicating copy to clipboard operation
datasette copied to clipboard

"Cannot use _sort and _sort_desc at the same time"

Open simonw opened this issue 2 years ago • 0 comments

Triggered this error while playing with the sort desc checkbox and the apply button that are only visible on this page at mobile screen width:

https://latest.datasette.io/fixtures/compound_three_primary_keys?_sort_desc=pk1

Navigate to that page (with the browser narrow enough to show the box), un-check the box and click Apply:

sort-bug

Also notable: I managed to get to a page with ?_sort_desk=pk1 in the URL three times by clicking around with that button.

simonw avatar May 03 '22 01:05 simonw

This isn't just a mobile display issue.

https://latest.datasette.io/fixtures/compound_three_primary_keys?_sort_desc=pk1 - click "Apply" and each time it adds another ?_sort_desc=pk1 to the URL.

This doesn't happen for ?_sort=pk - only for ?_sort_desc=pk1: https://latest.datasette.io/fixtures/compound_three_primary_keys?_sort=pk1

simonw avatar Aug 14 '22 16:08 simonw

That fixed both bugs.

simonw avatar Aug 14 '22 16:08 simonw