Skip to content

Conversation

jolbol1
Copy link
Contributor

@jolbol1 jolbol1 commented Oct 13, 2023

I noticed that the sort dropdown could not go back to "best match" after you have selected something else.

Appears to be because best match uses

    {
      name: 'Best match',
      href: { query: { ...router.query } }
    },

So it will just keep the queries that are currently there.

The fix is to delete these when generating the link component. Not sure if there is a better way to delete them in NextJs, without removing them all together (which would delete search ones too). Setting to null leaves these in the url &s=&o=.

Other option would be to make it so is sets the query params as "best" and sort as "desc".

@vercel
Copy link

vercel bot commented Oct 13, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @max-programming on Vercel.

@max-programming first needs to authorize it.

@jolbol1 jolbol1 changed the title 🐛 select cant go back to best match Select cant go back to best match Oct 13, 2023
@vercel
Copy link

vercel bot commented Oct 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hacktoberfest-projects 🛑 Canceled (Inspect) Oct 13, 2023 6:26pm

@max-programming
Copy link
Owner

I feel like this is the perfect solution! Thanks, James 😀

@max-programming
Copy link
Owner

@all-contributors please add @jolbol1 for code and bug

@allcontributors
Copy link
Contributor

@max-programming

I've put up a pull request to add @jolbol1! 🎉

@max-programming max-programming merged commit b9cbf4c into max-programming:main Oct 13, 2023
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

Successfully merging this pull request may close these issues.

2 participants