Skip to content

Commit 2496d77

Browse files
committed
Release v2.2.8
1 parent f706df4 commit 2496d77

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Diff for: dist/index.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-virtual-scroll-list v2.2.7
2+
* vue-virtual-scroll-list v2.2.8
33
* open source under the MIT license
44
* https://github.com/tangbc/vue-virtual-scroll-list#readme
55
*/
@@ -683,7 +683,7 @@
683683
// return current scroll offset
684684
getOffset: function getOffset() {
685685
if (this.pageMode) {
686-
return document.documentElement[this.directionKey];
686+
return document.documentElement[this.directionKey] || document.body[this.directionKey];
687687
} else {
688688
var root = this.$refs.root;
689689
return root ? Math.ceil(root[this.directionKey]) : 0;
@@ -694,26 +694,27 @@
694694
var key = this.isHorizontal ? 'clientWidth' : 'clientHeight';
695695

696696
if (this.pageMode) {
697-
return document.documentElement[key];
697+
return document.documentElement[key] || document.body[key];
698698
} else {
699699
var root = this.$refs.root;
700-
return root ? root[key] : 0;
700+
return root ? Math.ceil(root[key]) : 0;
701701
}
702702
},
703703
// return all scroll size
704704
getScrollSize: function getScrollSize() {
705705
var key = this.isHorizontal ? 'scrollWidth' : 'scrollHeight';
706706

707707
if (this.pageMode) {
708-
return document.documentElement[key];
708+
return document.documentElement[key] || document.body[key];
709709
} else {
710710
var root = this.$refs.root;
711-
return root ? root[key] : 0;
711+
return root ? Math.ceil(root[key]) : 0;
712712
}
713713
},
714714
// set current scroll position to a expectant offset
715715
scrollToOffset: function scrollToOffset(offset) {
716716
if (this.pageMode) {
717+
document.body[this.directionKey] = offset;
717718
document.documentElement[this.directionKey] = offset;
718719
} else {
719720
var root = this.$refs.root;

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-virtual-scroll-list",
3-
"version": "2.2.7",
3+
"version": "2.2.8",
44
"description": "A vue component support big amount data list with high scroll performance.",
55
"main": "dist/index.js",
66
"files": [

0 commit comments

Comments
 (0)