-
Notifications
You must be signed in to change notification settings - Fork 2k
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 not cleared when elements reused in dom-repeat. #3288
Comments
Yes, this looks like a bug with the data configuration process Polymer uses to efficiently flow binding data to other Polymer elements at initial construction of the tree. It incorrectly passes attribute bindings as property data. This should be trivial to fix, such that the label property is always |
Yes, that is what I would expect. |
Exclude attribute bindings from configuration. Fixes #3288.
Configure attr's with property effects. More robust fix for #3288.
Will this have a carry-over affect on the "for" property in the label. I just was wondering if the prop to atts initial config was intentional to keep the for attribute inline with the with the label and related input. I have been doing a lot of input work, so this could be an "over thinking moment on my part" but a similar issue happened with a paper-input fix a few weeks ago, so i thought it better to say something than just shhhh.... |
From @kayur on December 24, 2015 8:36
I'm trying to use dom-repeat to create a list of paper buttons, which have a custom attribute that I set. The html template for the custom element is a bit complicated but here is an example that illustrates the core issue:
<my-element>
has an propertyexperiments
which gets updated frequently with new data.experiments
is used to generate a list of<paper-button>
with a custom attributelabel
that's set toitem.name
.Let's set
experiments = [{ name: "joe", job: "plumber"}, { name: "cat", job: "maker"}]
Let's call the first paper button,
button
. I would expectbutton.getAttribute(label) === joe
andbutton.label === undefined
. That's not the case. Some magic setsbutton.label
tojoe
. That's fine. It could be useful magic.Now let's set
experiments = [{name: "cat", job: "maker"}]
. I would expectbutton.getAttribute(label) === cat
, and indeed that's correct. Butbutton.label === joe
.Why is this happening?
It feels like a bug because I'd expect reused elements not have zero state that indicates they were used for anything else before.
Here is a jsbin with this example:
http://jsbin.com/hetazocaye/6/edit?html,js,console,output
Strangely div does the right thing.
http://jsbin.com/rekavifozu/3/edit?html,js,console,output
Copied from original issue: PolymerElements/paper-elements#62
The text was updated successfully, but these errors were encountered: