Skip to content

Commit 1c26543

Browse files
committed
Fixed end index calc error when list clear. #119
1 parent cd85dff commit 1c26543

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

dist/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,12 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
319319
var isLast = index <= delta.total && index >= lastStart || index > delta.total;
320320

321321
if (isLast) {
322-
end = delta.total - 1;
323322
start = Math.max(0, lastStart);
324323
} else {
325324
start = index;
326-
end = start + delta.keeps - 1;
327325
}
328326

327+
end = start + delta.keeps - 1;
329328
return {
330329
end: end,
331330
start: start,

package.json

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

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,13 @@
327327
const lastStart = delta.total - delta.keeps
328328
const isLast = (index <= delta.total && index >= lastStart) || (index > delta.total)
329329
if (isLast) {
330-
end = delta.total - 1
331330
start = Math.max(0, lastStart)
332331
} else {
333332
start = index
334-
end = start + delta.keeps - 1
335333
}
336334

335+
end = start + delta.keeps - 1
336+
337337
return {
338338
end,
339339
start,

0 commit comments

Comments
 (0)