-
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
Elements created at runtime, can't know when ready #1158
Comments
Instead of doing it that way, you can can just set up a mutation observer on the parent element and listen for changes to its children. https://www.polymer-project.org/docs/polymer/polymer.html#onMutation |
Hey miztroh, First of all, thank you for the quick response. Your answer is good for my specific problem, but we need a more global solution. If my parent had other children, which are not tags, then your solution wouldn't work for me. I think that being able to bind to an element's lifecycle methods could be very helpful in many scenarios. |
I'm not sure whether Polymer element lifecycle events bubble up. However, if you have another scenario in mind, I might have another suggestion that works there too ;) |
You can use |
Ended up using this.async. Thank you for your help :). |
Hello,
I have a dynamic list of tags, which are held in an array, and change during runtime.
I have a created a custom element called "feed-tag" which is used to represent a single tag.
To actually create the feed-tags, I have the following code:
Everytime a tag is added, I check if there is an overflow, and decide if to turn the horizontal list of tags into a dropdown menu. Now since, there is a delay between the adding of a tag, to the actual creation of the feed-tag element, my overflow check results are wrong. I tried to bind to polymer's "ready" event using the following options, but was unsuccessful:
I know I can fire a custom event, from within the feed-tag element, but it just seems wrong to have to do it.
So my question is, is there anyway to bind to Polymer's ready event from the outside?
The text was updated successfully, but these errors were encountered: