how to restore URL after clicking the backbutton?

Viewed 19

My /htmx webpage has a list of links like this one:

<li class="collection-item" hx-push-url="true" hx-post="/htmx/file/open/specification.idp" 
hx-trigger="click" hx-target="#screen">Click me</li>

When I click it, the #screen target is correctly updated, and the browser URL is correctly changed to /htmx/file/open/specification.idp (thanks to hx-push-url="true").

When I click the browser back button, the original htmx page is properly displayed, but the browser URL remains /htmx/file/open/specification.idp, instead of becoming /htmx.

How can I get the browser URL to be /htmx? I'm using Htmx 1.8.0. I also tried using hx-get.

0 Answers
Related