Simplify PseudoVirtualList (#93)

Possible fix for #92
This commit is contained in:
Nolan Lawson 2018-04-12 19:38:41 -07:00 committed by GitHub
parent 7ece5d7ffc
commit 3786473e34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,4 @@
<div class="pseudo-virtual-list" on:initialized ref:node> <div class="pseudo-virtual-list" on:initialized ref:node>
{{#if wrappedItems}}
{{#each wrappedItems as wrappedItem, i @item}} {{#each wrappedItems as wrappedItem, i @item}}
<PseudoVirtualListLazyItem <PseudoVirtualListLazyItem
component="{{component}}" component="{{component}}"
@ -13,7 +12,6 @@
height="{{getHeight(wrappedItem.item, $intersectionStates)}}" height="{{getHeight(wrappedItem.item, $intersectionStates)}}"
/> />
{{/each}} {{/each}}
{{/if}}
</div> </div>
<style> <style>
.pseudo-virtual-list { .pseudo-virtual-list {
@ -107,7 +105,7 @@
} }
}, },
computed: { computed: {
wrappedItems: (items) => items && items.map(item => ({item: item})), wrappedItems: (items) => items ? items.map(item => ({item})) : [],
allItemsHaveHeight: (items, $intersectionStates) => { allItemsHaveHeight: (items, $intersectionStates) => {
if (!items) { if (!items) {
return false return false