Skip to content

Commit

Permalink
Handle iOS scroll bounce without the jitters
Browse files Browse the repository at this point in the history
If we're at a scrollTop above 0, just avoid triggering the scroll event entirely, or maybe I should pass the event through.
This is a McDonalds fix, feel free to critique this as needed. Thanks!
Resolves bvaughn#532
  • Loading branch information
toddtarsi authored Feb 7, 2017
1 parent c0e6e68 commit 45f8fd8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/Grid/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,12 @@ export default class Grid extends Component {
return
}

// On iOS, we can arrive at negative offsets by swiping past the start
// To prevent flicker here, we make playing in the negative offset zone cause nothing to happen.
if (event.target.scrollTop < 0) {
return
}

// Prevent pointer events from interrupting a smooth scroll
this._debounceScrollEnded()

Expand Down

0 comments on commit 45f8fd8

Please sign in to comment.