Skip to content

Commit

Permalink
attach to touchmove event to trigger this.onScroll (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
lipp authored and zemirco committed Mar 16, 2018
1 parent e14d793 commit b6c3faf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/js/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ export default class Header extends React.Component {
componentDidMount () {
if (this.props.shadowOnScroll) {
window.addEventListener('scroll', this.onScroll)
window.addEventListener('touchmove', this.onScroll)
}
}

componentWillUnmount () {
if (this.props.shadowOnScroll) {
window.removeEventListener('scroll', this.onScroll)
window.removeEventListener('touchmove', this.onScroll)
}
}

Expand Down

0 comments on commit b6c3faf

Please sign in to comment.