Skip to content

Commit 832a5ba

Browse files
committed
refactor: Use absolute scroll diff
1 parent 35c0ad2 commit 832a5ba

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/components/RecycleScroller.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@ export default {
298298
299299
// Skip update if use hasn't scrolled enough
300300
if (checkPositionDiff) {
301-
let positionDiff = scroll.originalStart - this.$_lastUpdateScrollPosition
302-
if (positionDiff < 0) positionDiff = -positionDiff
301+
const positionDiff = Math.abs(scroll.originalStart - this.$_lastUpdateScrollPosition)
303302
if ((itemSize === null && positionDiff < minItemSize) || positionDiff < itemSize) {
304303
return {
305304
continuous: true,

0 commit comments

Comments
 (0)