From a3af8ae223cb1be67e8549f0c08a38c74c105d4d Mon Sep 17 00:00:00 2001 From: Griff0ly0n Date: Sat, 31 Mar 2018 16:30:34 +0530 Subject: [PATCH] Prevent duplication of cells while filtering --- addon/components/ember-collection.js | 48 ++++++++-------------------- 1 file changed, 13 insertions(+), 35 deletions(-) diff --git a/addon/components/ember-collection.js b/addon/components/ember-collection.js index 1f859208..eb24b623 100644 --- a/addon/components/ember-collection.js +++ b/addon/components/ember-collection.js @@ -36,7 +36,6 @@ export default Component.extend({ // this.cellCount = undefined; this.contentElement = undefined; this._cells = A(); - this._cellMap = Object.create(null); // TODO: Super calls should always be at the top of the constructor. // I had to move the super call after the properties were defined to @@ -141,9 +140,6 @@ export default Component.extend({ this._cellLayout.length = numItems; } - var priorMap = this._cellMap; - var cellMap = Object.create(null); - var index = this._cellLayout.indexAt(this._scrollLeft, this._scrollTop, this._clientWidth, this._clientHeight); var count = this._cellLayout.count(this._scrollLeft, this._scrollTop, this._clientWidth, this._clientHeight); var items = this._items; @@ -157,40 +153,24 @@ export default Component.extend({ for (i=0; i