How to force my app to reload itself with new query params?

I have used the instructions Access and Manipulate the URL — Panel v1.4.2 to change my app’s query parameters on the fly.

Now, I want to force the app to reload itself at that new URL.

I tried setting pn.state.location.reload=True – didn’t help

As a hack, you can try setting reload=False and then reload=True.

import panel as pn
pn.extension()

def handle_click(event):
    pn.state.location.param.update(search="?color=blue"), 
    pn.state.location.reload=False
    pn.state.location.reload=True
    print("handled")

pn.widgets.Button(name="Navigate to google", on_click=handle_click).servable()

It reloads the page for me. But I think that pn.state.location does not work as you could expect as a user. Feel free to file an issue on Github.

Setting reload to False and then back to True did the trick – thanks for the tip!