Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #57 from jacekk/issues/56/scroll-top-detection
Browse files Browse the repository at this point in the history
Fix: Unable to get property 'scrollTop' of undefined or null reference
  • Loading branch information
TylerBarnes authored Mar 25, 2019
2 parents 3f7c664 + b3aad7b commit 63890d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/AniLink/Fade.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const fade = ({ exit: { length }, node, direction }) => {
const duration = direction === "out" ? length + length / 4 : length;
const opacity = direction === "in" ? 1 : 0;
const scrollTop =
document.scrollingElement.scrollTop ||
(document.scrollingElement && document.scrollingElement.scrollTop) ||
document.body.scrollTop ||
window.pageYOffset;

Expand Down
2 changes: 1 addition & 1 deletion src/AniLink/Swipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const swipeBottomDirection = (direction, reverse = false, offset = 40) => {

const swipe = ({ node, exit, direction, top, triggerName, entryOffset }) => {
const scrollTop =
document.scrollingElement.scrollTop ||
(document.scrollingElement && document.scrollingElement.scrollTop) ||
document.body.scrollTop ||
window.pageYOffset;

Expand Down

0 comments on commit 63890d6

Please sign in to comment.