-
Notifications
You must be signed in to change notification settings - Fork 131
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
Properties of elements inside the list not reseted when element gets recycled #257
Comments
Does this happen if your properties have default values? |
Yes still the same issue! If I just "check" one element, it seems OK. I also have an observer on the "check" property to add/remove class to the feed:
|
Live demo: |
@NicolasRannou I believe you are setting states imperatively. e.g. calling e.g. <iron-list id="list" items="[[items]]" as="item" selection-enabled multi-selection>
<template>
<div>
<x-element checked="[[selected]]"><x-element/>
</div>
</template>
</iron-list> In your original comment, you have |
Hmm I tried many things but I couldn't get it to work. Is it a bad practice with the iron-list to dynamically add classes to the element?
|
I can replicate this with an even simpler example. Its not just properties but pseudo css classes too. |
DescriptionGiven an iron-list, i expect properties and pseudo css classes to reset as I scroll through the list. Take the collapse.html demo and add a simple item:hover{ background: red; } class to the css. Expected outcomeWhen I scroll down a list, future items should not have the red background. Actual outcomeVery often I will see a red background on the incoming items. Steps to reproduce1 Take the collapse.html demo and add this to the CSS
2 Open the demo. Hover over an item and see the hover class applied. This seems to be most reproducible when you hover over any item that is not the first item in the list |
Wouldn't it a good Idea, that we support a non Recyling mode? For example in WPF you can specify if a Vistualizing Stackpanel recycles or not! |
I'm facing similar issue when trying to delete items from the list |
Description
Given the following setup:
<chris-feed>
properties:If I set
checked = true
in my<chris-feed>
, when I scroll down the list, I will find another<chris-feed>
item checked.As I understand it, it happens because elements are being re-cycled by the
<iron-list>
.Is it the expected behavior? Shouldn't the element's property be cleaned up somehow? My current workaround is to attach the
checked
property inside thefeed
object in the<chris-feed>
element.Expected outcome
Properties should be reset when an element of the list is being recycled.
Actual outcome
Properties are not being reset.
Browsers Affected
The text was updated successfully, but these errors were encountered: