Skip to content

Commit

Permalink
Infinite forceRender fix
Browse files Browse the repository at this point in the history
  • Loading branch information
scarry1992 committed Feb 17, 2020
1 parent cdc2aa3 commit 3b2cb51
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion demos/item-mode/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/page-mode/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/scroll-element/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/table-mode/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/variable-height/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/vfor-mode/build.js

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
},
// return the right zone info based on `start/index`.
getZone: function getZone(index) {
var start;
var start, end;
var delta = this.delta;
index = parseInt(index, 10);
index = Math.max(0, index);
Expand All @@ -340,8 +340,14 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
start = index;
}

end = start + delta.keeps - 1;

if (end > delta.total) {
end = delta.total - 1;
}

return {
end: start + delta.keeps - 1,
end: end,
start: start,
isLast: isLast
};
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@

// return the right zone info based on `start/index`.
getZone (index) {
let start
let start, end
const delta = this.delta

index = parseInt(index, 10)
Expand All @@ -346,9 +346,13 @@
} else {
start = index
}
end = start + delta.keeps - 1
if (end > delta.total) {
end = delta.total - 1
}

return {
end: start + delta.keeps - 1,
end,
start,
isLast
}
Expand Down

0 comments on commit 3b2cb51

Please sign in to comment.