Skip to content

Commit feb2135

Browse files
authored
Fix infinite scrollToBottom method (#390)
1 parent 4fc245e commit feb2135

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: dist/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@
848848
// so we need retry in next event loop until it really at bottom
849849

850850
setTimeout(function () {
851-
if (_this.getOffset() + _this.getClientSize() < _this.getScrollSize()) {
851+
if (_this.getOffset() + _this.getClientSize() + 1 < _this.getScrollSize()) {
852852
_this.scrollToBottom();
853853
}
854854
}, 3);

Diff for: docs/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@
790790
// so we need retry in next event loop until it really at bottom
791791

792792
setTimeout(function () {
793-
if (_this.getOffset() + _this.getClientSize() < _this.getScrollSize()) {
793+
if (_this.getOffset() + _this.getClientSize() + 1 < _this.getScrollSize()) {
794794
_this.scrollToBottom();
795795
}
796796
}, 3);

Diff for: src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const VirtualList = Vue.component('virtual-list', {
180180
// maybe list doesn't render and calculate to last range
181181
// so we need retry in next event loop until it really at bottom
182182
setTimeout(() => {
183-
if (this.getOffset() + this.getClientSize() < this.getScrollSize()) {
183+
if (this.getOffset() + this.getClientSize() + 1 < this.getScrollSize()) {
184184
this.scrollToBottom()
185185
}
186186
}, 3)

0 commit comments

Comments
 (0)