Basically, I need to have temporary variables for holding the desired value for each search parameter that I supplied to ais-configure. And when the user clicks on the search button, I set them as the value for the real variable, then update the URL manually:
This is where the problem happens because for some reason, I can’t get the property type to stay on the address bar. When I click on search, it will be assigned as a query parameter for a second and disappears the next. The way I’m setting it doesn’t seem to be recognized by Algolia:
My question is, is there a better way of doing this? I’m managing the URL manually which is rather clunky. I just want to make it so that when I visit a URL that looks like this: https://n1odt.csb.app/search?query=bar&property_type=Villa, it’s gonna fill out the relevant fields and have the correct state. The same should also be true the other way around: everytime I click on the search button, the property_type and query should update in the URL.