Skip to content

Commit 0d7d686

Browse files
authored
fix: totop event was only triggered for once (#394)
1 parent 1a687dc commit 0d7d686

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/virtual.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export default class Virtual {
137137

138138
// calculating range on scroll
139139
handleScroll (offset) {
140-
this.direction = offset < this.offset ? DIRECTION_TYPE.FRONT : DIRECTION_TYPE.BEHIND
140+
this.direction = offset < this.offset || offset == 0 ? DIRECTION_TYPE.FRONT : DIRECTION_TYPE.BEHIND
141141
this.offset = offset
142142

143143
if (!this.param) {

0 commit comments

Comments
 (0)