ember-collection
ember-collection copied to clipboard
Prevent duplication of cells while filtering
Certain elements in an 'ember-collection' based list is rendered more than once, when filtering is performed on the list. I noticed this issue when i tried to use 'ember-collection' inside 'ember-power-select'. Below images depict this issue,
List showing duplicates
Duplicates in DOM
I traced down the root cause of this issue being related to presence of 'cellMap', which seems to be a lookup to check if the cell is already being rendered or not. Avoiding this lookup when inserting new items, resolve the issue.