googlearchive / core-list

Polymer virtualized list element
25 stars 20 forks source link

Rendering bug when using grouped list without child elements #68

Open simonseyer opened 9 years ago

simonseyer commented 9 years ago

When using the grouped version of the core-list, it happens that dividers and items are drown one above the other, when there are groups which don't have child elements in between.

The bug could be simply reproduced:

<core-list data="{{erroneousData}}" groups="{{groups}}">
  <template>
    <div divider class="divider">{{groupModel.name}}</div>
    <div class="item">
      {{model.name}}
    </div>  
  </template>
</core-list>
groups: [{'name' : 'Group A'},{'name' : 'Group B'},{'name' : 'Group C'}],
erroneousData: [[{'name':'a'}],[],[{'name':'c'}, {'name':'d'}]],

With the code shown above, the following list is rendered: bildschirmfoto 2015-01-17 um 16 41 01

If there are empty groups at the beginning or the end of the list, everything works fine.

I created a simple example that shows the issue: https://gist.github.com/372465021f7045e46bdd