Is alpine data synchronized with URL hash? #634
piotrpog
started this conversation in
4. General
Replies: 1 comment 2 replies
-
Alpine doesn't sync with the url, clicking back it's just going to the previous entry in your browser history so components are just reinitialised. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an app with
x-data
like this:As you can see, I use
$watch
to append hash to URL when variableopen
changes. But when the hash is appended and then I click the browser back button, variable changes to the previous state. Is this some undocumented behavior? When after this I click forward button, hash again changes tomenu
, but this time the variable won't change the second time.I tried to do something like this:
But this causes even stranger behavior - when i change variable hash appears and then when click back button, url changes for a second to one without hash and then hash appears again.
Beta Was this translation helpful? Give feedback.
All reactions