-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
There has been several reports about clicking hyperlinks does not give the expected behaviour. We have two specific scenarios:
-
create two
.htmlfiles and create a link to move from one to the other. When you now change the code and save it refreshes theindex.htmlfile instead of the one you are on. Can not see the addressbar reflecting moving between HTML files at all -
Create hyperlinks with hashes pointing to IDs of elements on the page. The expected behaviour is that the preview window jumps to the element when you click the link. This does not happen
app/sandbox-hooks/url-listeners.js is the file that is responsible for intercepting URL changes and send them up to the addressbar (sendUrlChange). We still need this logic, but we want to re-evaluate the click listener further down in the file.
So I would suggest doing normal tracking here instead. One for popstate and one for hashchange:
https://gomakethings.com/how-to-detect-when-the-browser-url-changes-with-vanilla-js/