Description
Navigating back in the browser history causes the entire page to reload, even when the navigation stays within the same page. If you go to an anchor point within the same page (for example #test) and then go back on history, the whole page reloads instead of just navigating within the same page.
How we encountered this
We (freitag.de) are currently implementing a third-party widget that opens a modal when clicked on. When the modal is closed, it returns back in the browser history which is causing this full page load.
How to reproduce
- Open classic.demo.plone.org
- Add
#test to the end of the URL and press Enter. (No reload yet)
- Press the browser's Back button. (alternatively run
history.back() on the browser's console)
Expected behavior: URL simply changes back to /en without full page reload.
What is actually happening: The whole page reloads.
Thoughts on why is happens
When the page is loaded initially; the state is marked as pageload, and then it adds a popstate listener which reloads the page when there is a history change. I think the culprit is culprit is inject.js, lines 1165–1186.
Description
Navigating back in the browser history causes the entire page to reload, even when the navigation stays within the same page. If you go to an anchor point within the same page (for example
#test) and then go back on history, the whole page reloads instead of just navigating within the same page.How we encountered this
We (freitag.de) are currently implementing a third-party widget that opens a modal when clicked on. When the modal is closed, it returns back in the browser history which is causing this full page load.
How to reproduce
#testto the end of the URL and press Enter. (No reload yet)history.back()on the browser's console)Expected behavior: URL simply changes back to
/enwithout full page reload.What is actually happening: The whole page reloads.
Thoughts on why is happens
When the page is loaded initially; the state is marked as
pageload, and then it adds apopstatelistener which reloads the page when there is a history change. I think the culprit is culprit is inject.js, lines 1165–1186.