Skip to content

Commit

Permalink
refactor: Use absolute scroll diff
Browse files Browse the repository at this point in the history
  • Loading branch information
dam1r89 committed Apr 19, 2020
1 parent 35c0ad2 commit 552d7a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/RecycleScroller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,15 @@ export default {
// Skip update if use hasn't scrolled enough
if (checkPositionDiff) {
let positionDiff = scroll.originalStart - this.$_lastUpdateScrollPosition
if (positionDiff < 0) positionDiff = -positionDiff
const positionDiff = Math.abs(scroll.originalStart - this.$_lastUpdateScrollPosition)
if ((itemSize === null && positionDiff < minItemSize) || positionDiff < itemSize) {
console.log(`optimize`);
return {
continuous: true,
}
}
console.log(`render`);
}
}
Expand Down

0 comments on commit 552d7a1

Please sign in to comment.