Saulis / iron-data-table

iron-data-table is a Web Component for displaying data as a table or grid. Built on top of iron-list using Polymer.
Apache License 2.0
147 stars 66 forks source link

data fetched twice at initialization using dynamic size #188

Open Zecat opened 7 years ago

Zecat commented 7 years ago

To reproduce:

What happens: _dataSource is called twice = request duplication

Filling issue: -> _dataSource callback is called -> size updated -> _sizeChanged is triggered -> (size > oldSize) is true because oldSize = 0 -> refreshPage is called

Problem: data should not be refreshed when oldSize = 0

I propose to change https://github.com/Saulis/iron-data-table/blob/master/iron-data-table.html#L881

if (size > oldSize) {

with

if (oldSize && size > oldSize) {

nice element!