diff --git a/addon/components/paper-virtual-repeat.js b/addon/components/paper-virtual-repeat.js index 1f46ecbcf..49aeb2020 100644 --- a/addon/components/paper-virtual-repeat.js +++ b/addon/components/paper-virtual-repeat.js @@ -1,5 +1,6 @@ import { mapBy } from '@ember/object/computed'; import { run } from '@ember/runloop'; +import { assign } from '@ember/polyfills'; import { observer, set, get, computed } from '@ember/object'; import RSVP from 'rsvp'; import { A as emberArray } from '@ember/array'; @@ -23,13 +24,6 @@ const VirtualRepeatComponent = VirtualEachComponent.extend({ } }, - defaultAttrs: computed(function() { - return { - scrollTimeout: 30, - height: 48 - }; - }), - size: computed('initialSize', 'items.[]', 'itemHeight', function() { let itemSize = this.get('itemHeight'); let fullSize = this.get('items.length') * itemSize; @@ -112,6 +106,14 @@ const VirtualRepeatComponent = VirtualEachComponent.extend({ return Math.ceil(this.get('itemHeight') ? size / this.get('itemHeight') : 1) + EXTRA_ROW_PADDING; }).readOnly(), + init() { + this._super(...arguments); + this.set('defaultAttrs', assign({}, this.get('defaultAttrs') || {}, { + scrollTimeout: 30, + height: 48 + })); + }, + didInsertElement() { this._super(...arguments);