Skip to content

Commit

Permalink
fix: scroll to origin on mount
Browse files Browse the repository at this point in the history
  • Loading branch information
threequartersjohn authored and jgradim committed Apr 9, 2020
1 parent 2aa06f2 commit 8c201d5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Carousel extends Component {
window.addEventListener('keyup', this.handleKeyboardControlUp);
window.addEventListener('resize', this.handleResize);

this.containerRef.current.scrollLeft = 0;
this.containerRef.current.addEventListener('scroll', this.handleScroll);
document.body.addEventListener('touchmove', this.handleTouchScroll, { passive: false });

Expand Down

0 comments on commit 8c201d5

Please sign in to comment.