Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data fetched twice at initialization using dynamic size #188

Open
Zecat opened this issue Jan 23, 2017 · 0 comments
Open

data fetched twice at initialization using dynamic size #188

Zecat opened this issue Jan 23, 2017 · 0 comments

Comments

@Zecat
Copy link

Zecat commented Jan 23, 2017

To reproduce:

  • Let the default size to 0
  • Inform size dynamically using _dataSource callback second parameter

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant