From 2c38a1c6f1d9f640acc73540352f7f19df2729e6 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 27 Jun 2020 10:52:36 +0800 Subject: [PATCH 1/2] update --- src/base/list/listview.js | 1 - src/base/list/virtuallist.js | 1 - 2 files changed, 2 deletions(-) diff --git a/src/base/list/listview.js b/src/base/list/listview.js index b853f6c7db..e85bfb8858 100644 --- a/src/base/list/listview.js +++ b/src/base/list/listview.js @@ -105,7 +105,6 @@ BI.ListView = BI.inherit(BI.Widget, { populate: function (items) { if (items && this.options.items !== items) { - this.options.items = items; this.restore(); } this._populate(items); diff --git a/src/base/list/virtuallist.js b/src/base/list/virtuallist.js index 63bcc5cecf..97966bc311 100644 --- a/src/base/list/virtuallist.js +++ b/src/base/list/virtuallist.js @@ -173,7 +173,6 @@ BI.VirtualList = BI.inherit(BI.Widget, { populate: function (items) { if (items && this.options.items !== items) { - this.options.items = items; this.restore(); } this._populate(items); From bf9fff134fc06648de85bd8f0d1c40d0436dde33 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 27 Jun 2020 10:55:01 +0800 Subject: [PATCH 2/2] update --- src/base/list/virtuallist.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/base/list/virtuallist.js b/src/base/list/virtuallist.js index 97966bc311..905c06ca55 100644 --- a/src/base/list/virtuallist.js +++ b/src/base/list/virtuallist.js @@ -132,9 +132,8 @@ BI.VirtualList = BI.inherit(BI.Widget, { } this.container.element.prepend(firstFragment); this.container.element.append(lastFragment); - this.topBlank.setHeight(this.cache[start < 0 ? 0 : start].scrollTop); - var lastCache = this.cache[Math.min(end, this.renderedIndex)]; - this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - lastCache.scrollTop - lastCache.height); + this.topBlank.setHeight(this.tree.sumTo(Math.max(-1, start - 1))); + this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex))); BI.each(needDestroyed, function (i, child) { child && child._destroy(); });