Open JustWaveThings opened 6 months ago
Thanks @JustWaveThings, this is a great point!
I'm leaning towards always going back to the start when the sort is changed. I can see some benefit in maintaining your position in the list within the pagination. But going back to the start seems like it would be more useful with the sort options we make available.
I wouldn't mind getting some third and fourth opinions about it before going ahead though aha.
It won't be hard to do - we're handling the params for the sort here. If pagination has been used, the page param will be implicitly merged into the selected sort params and sent over the wire together. If we want the sort to always go back to the start, we can do that by explicitly overriding the page param with page: 1
as one of the params.
@KevinMulhern I think it would make more sense to jump to page 1 whenever a sorting change is made by the user too. Because whenever users change the sorting rule, they are definitely expecting to view the data from page 1 again. (At least in my case!)
I am sorry I did't catch this when you were looking for people to review it.
Checks
Bug: brief description of bug
format, e.g.Bug: Lesson complete button does not update on click
Bug description
When there is pagination in the project list, changing the
sort by
doesn't take the user to, for example, 'the most liked' projects. It applies the sort correctly but stays on the current page.You can see I'm on page 2, and I've changed my sort to 'most liked', but I'm still on page 2, not seeing the most liked, which are on page 1.![image](https://github.com/TheOdinProject/theodinproject/assets/48169481/0a2682f1-8faa-41f3-b740-8cd29a0d2f3b)
How to reproduce
sort=likes_count
but is still on page 2, not showing the most liked. after sort changeExpected behavior
What browsers are you seeing the problem on?
Chrome
What OS are you using?
MacOS
Discord Name
Fred | Blog API
Additional Comments
I love the feature, and I'm making the assumption here that this is not the desired behavior. If it is, It's not a big lift to manually click the page number to navigate to.