Skip to content

Commit

Permalink
Merge pull request #5 from ibarrick/chips-fix
Browse files Browse the repository at this point in the history
fixed virtual repeat for autocomplete
  • Loading branch information
pauln authored Nov 7, 2016
2 parents 962e955 + 8434910 commit 39b4002
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions addon/components/paper-virtual-repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ const VirtualRepeatComponent = VirtualEachComponent.extend({

}).readOnly(),

visibleItemsVirtual: computed.map('_items', function(item, index) {
return { raw: item, virtualIndex: index };
}).readOnly(),

visibleItems: computed('_startAt', '_visibleItemCount', '_items', function() {

let items = get(this, '_items');
Expand All @@ -214,15 +218,10 @@ const VirtualRepeatComponent = VirtualEachComponent.extend({
items[i] = getAtIndex(i);
}
}
this.notifyPropertyChange('_items');
}

return items.slice(startAt, endAt).map((item, index) => (
{
raw: item,
actualIndex: startAt + index,
virtualIndex: index
})
);
return this.get('visibleItemsVirtual').slice(startAt, endAt);
}).readOnly(),

scrollToVirtualItem(newIndex, toTop=false) {
Expand Down

0 comments on commit 39b4002

Please sign in to comment.