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

iron-list doesn't appear to be observing array changes #193

Closed
indolering opened this issue Feb 6, 2016 · 4 comments
Closed

iron-list doesn't appear to be observing array changes #193

indolering opened this issue Feb 6, 2016 · 4 comments

Comments

@indolering
Copy link
Contributor

I recently ran into trouble with value$= data bindings in iron-list, I wasn't able to replicate that exact issue but it appears as if iron-list isn't observing array change notification declared using computed bindings or observers. I've setup examples of both and if you try to delete a record (which utilizes this.splice), iron-list will not update.

@indolering
Copy link
Contributor Author

I would think that this is a p0 issue given that this blocks updating values to iron-list elements and essentially breaks data-binding.

@blasten
Copy link
Contributor

blasten commented Feb 13, 2016

@indolering this one does work: http://jsbin.com/qasahupapi/1/edit?html,output iron-list currently doesn't support array filtering in the same way dom-repeat does. That feature is in the backlog and we do want to fully support it. It's just a matter of priorities.

Things to keep in mind:

  • Observe to items.* to get notification for splices.
  • If the array is mutated without using the Polymer's mutation API, the only way to reflect the changes is to create a copy of the array. That's why you see the array.slice.

Also, this a temporary solution. Generally speaking calling array.slice is just hack here.

Related: #123

@indolering
Copy link
Contributor Author

Something screwy is still going on in my actual codebase, but updating to 1.2.4 and appending records.* appears to have fixed the majority of issues.

@blasten
Copy link
Contributor

blasten commented Feb 17, 2016

good2know

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

No branches or pull requests

3 participants