-
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
attributeChanged is not called under some circumstances #438
Comments
example is a little bit complicated than i describe.ill try to reproduce this in a simple way (i'm not able to publish part of the project). |
Example: but i could find polymer-flex-layout.html in CDN. Steps to reproduce: click "show 1", "show 2", "show 1". after last click method layoutContainerChanged inside polymer-flex-layout is not called for component inside polymer-test1 |
The binding mechanism that controls things like
Thanks for reporting this! |
After discussing this with @frankiefu and @sorvell, I remember why Because MDV must keep references to the element to process data binding, we have to dispose of the data bindings on removal from the DOM, or there will be a memory leak. Therefore, you have to be the one to call Whenever javascript gains a Weak Reference, or MDV becomes native, then we can remove this restriction. @ebidel This seems like an important topic to cover in the databinding docs (probably in big text). |
We have extensive docs on "life of a binding" here: This will probably find its way into the data-binding docs after they're revamped. |
@ebidel Ah good! I was expecting to find it in the Data Binding section, maybe there should be a link there as well? |
When Element created dynamically and appended to the dom:
var el = new PolymerSampleElement();
document.body.appendChild(el);
method attributeChanged called.
then you remove this element from the dom:
document.body.removeChild(el);
when you try to add, already created, element back to the dom method attributeChanged is not called.
The text was updated successfully, but these errors were encountered: