#Progressive enhancement for combobox?
1 messages · Page 1 of 1 (latest)
I understand you're building a searchbox that will show suggested results below it inside a dropdown?
In that case you need JS to build that
but if you want to ensure it can still work without JS, create a separate route for the search results
this way a user without JS will type the thing it's searching for and submit the form
the form will redirect the user to /search?query=<what the user typed>
and there you can show the results
but if the user has JS it use a fetcher to get the results (a nice side-effect is that you can now use the /search route to fetch the results) and show them in the dropdown