Open stuthemoo opened 2 hours ago
Seems to be relateed to the loop option. If it's true then looping back to the first section will make the url hash 1 more than the total rater than setting it back to #1. If you then reload it looks for a section that doesn't exist and breaks.
For a quick fix change line 83 from:
if(window.location.hash != "" && window.location.hash != "#1") {
to:
if(window.location.hash != "" && window.location.hash != "#1" && document.querySelector(settings.sectionContainer + "[data-index='" + (window.location.hash.replace("#", "")) + "']")) {
https://github.com/peachananr/purejs-onepage-scroll/blob/b86163211c9e40019a2223bf85f0ad02aa0cf57f/onepagescroll.js#L83
Sometimes on page load I get this error and I cannot scroll to the next section