Skip to content

Commit b1b72fe

Browse files
committed
Ensure start and end is right before render. #88
1 parent 7343f19 commit b1b72fe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,14 @@
359359
delta.paddingBottom = paddingBottom
360360
delta.offsetAll = allHeight - this.size * this.remain
361361

362-
var targets = []
362+
// here we shoud try getZone to ensure start/end is right after new list. #88
363+
var zone = this.getZone(delta.start)
364+
if (zone.start !== delta.start || zone.end !== delta.end) {
365+
delta.end = zone.end
366+
delta.start = zone.start
367+
}
363368

369+
var targets = []
364370
for (var i = delta.start; i <= Math.ceil(delta.end); i++) {
365371
// create vnode, using custom attrs binder.
366372
var slot = this.item ? this.$createElement(this.item, this.itemprop(i, this.items[i])) : slots[i]
@@ -389,7 +395,7 @@
389395
var zone = this.getZone(calcstart)
390396

391397
// if start, size or offset change, update scroll position.
392-
if (~['start', 'size', 'offset'].indexOf(this.alter)) {
398+
if (this.alter && ~['start', 'size', 'offset'].indexOf(this.alter)) {
393399
var scrollTop = this.alter === 'offset'
394400
? this.offset : this.variable
395401
? this.getVarOffset(zone.isLast ? delta.total : zone.start)

0 commit comments

Comments
 (0)