-
Notifications
You must be signed in to change notification settings - Fork 44
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
Parent polymer elements dont seem to react to change in children. #34
Comments
Hi! This indeed looks like our bug. Two things I found so far that might be helpful:
Probably a bug in About triggering the property change effects, I think that changing the property value to something else and back to the desired value is the only way to trigger them. There is a check for the value change that sets this requirement in the |
Thanks! |
Further research findings: the issue is probably caused by the fact that in The reason I think of is: when changing the menu options with binding, Angular 2 removes the DOM nodes before adding the new ones. Calling |
tldr: When children of paper-dropdown-menu are updated by Angular, the parent does not reload or react to the change. The "selected" option does not bind to the new items, for example, unless we update it as well. The example code is available here: https://github.com/dirtysanchez69/issue-angular2-polymer
Say I have a paper-dropdown-menu, as such (this works fine):
In this case, the child (paper-item) is presumably parsed before the parent (paper-listbox), and the parent selects the second of its children to be the selected value.
Now, if the options arrive a bit later, after an async event, the options (paper-items) are updated just fine, but we lose the selected value.
If dropdownOptions.fruit is initialized with some values, we see the selected value, but upon updating them, the selected value disappears.
Now, if we also bind the selected value, and we update that as well upon receiving the new data, then the new selected value is displayed (hooray). However, this only works if we actually change the value of the "selected" property. If we initialize this value to 1, then we must pick another number in order to trigger the update (which still leaves us with a problem).
What do you think of this?
Is there a clean way to forcibly trigger a reload on a polymer element?
The text was updated successfully, but these errors were encountered: