Skip to content

Commit

Permalink
Revert 8857680 since it caused a regression (see note on PR #616)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Mar 31, 2017
1 parent d2340c4 commit 5d6cea6
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions source/Grid/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,15 @@ export default class Grid extends PureComponent {
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()

const { autoHeight, height, width } = this.props

const {
Expand All @@ -1057,18 +1066,6 @@ export default class Grid extends PureComponent {
const scrollLeft = Math.min(Math.max(0, totalColumnsWidth - width + scrollbarSize), eventScrollLeft)
const scrollTop = Math.min(Math.max(0, totalRowsHeight - height + scrollbarSize), eventScrollTop)

// On iOS, we can arrive at negative offsets by swiping past the start or end.
// Avoid re-rendering in this case as it can cause problems; see #532 for more.
if (
eventScrollLeft !== scrollLeft ||
eventScrollTop !== scrollTop
) {
return
}

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

// Certain devices (like Apple touchpad) rapid-fire duplicate events.
// Don't force a re-render if this is the case.
// The mouse may move faster then the animation frame does.
Expand Down

0 comments on commit 5d6cea6

Please sign in to comment.