Skip to content

Commit

Permalink
fix(ScrollObserver): add support for IE (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
KrivonosPaul authored and ooHmartY committed Aug 23, 2018
1 parent bdf7729 commit dfa80c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/ScrollObserver/Provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export default class ScrollObserverProvider extends React.Component {
/* istanbul ignore next */
this.ticking = false;
/* istanbul ignore next */
const scrollY = window.scrollY; // eslint-disable-line
const scrollY =
window.scrollY ||
window.pageYOffset ||
document.documentElement.scrollTop ||
document.body.scrollTop;
/* istanbul ignore next */
this.setState(() => ({ scrollY }));
};
Expand Down

0 comments on commit dfa80c5

Please sign in to comment.