diff --git a/modules/mixins/utils.js b/modules/mixins/utils.js index c6480e5..161ba27 100644 --- a/modules/mixins/utils.js +++ b/modules/mixins/utils.js @@ -6,8 +6,9 @@ const updateHash = (hash, historyUpdate) => { ? curLoc.pathname + curLoc.search + hashToUpdate : curLoc.pathname + curLoc.search; historyUpdate - ? history.pushState(null, "", urlToPush) - : history.replaceState(null, "", urlToPush); + ? history.pushState(history.state, "", urlToPush) + : history.replaceState(history.state, "", urlToPush); + }; const getHash = () => { @@ -39,8 +40,8 @@ const scrollOffset = (c, t, horizontal) => { return c === document ? t.getBoundingClientRect().left + (window.scrollX || window.pageXOffset) : getComputedStyle(c).position !== "static" - ? t.offsetLeft - : t.offsetLeft - c.offsetLeft; + ? t.offsetLeft + : t.offsetLeft - c.offsetLeft; } else { if (c === document) { return ( diff --git a/package-lock.json b/package-lock.json index 0b90f4d..66da265 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,12 @@ { "name": "react-scroll", - "version": "1.8.2", + "version": "1.8.5", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.8.2", + "name": "react-scroll", + "version": "1.8.5", "license": "MIT", "dependencies": { "lodash.throttle": "^4.1.1",