Perhaps this simple example will help explain the behavior and extend to comments.
<dom-module id="change-tester"> <template> <h1>Change Tester</h1> <ul> <template id="template" is="dom-repeat" items="{{content}}"> <li>{{item}}</li> </template> </ul> <button on-click="more">Add more</button> </template> </dom-module> <script> Polymer({ is: 'change-tester', properties: { content: { type: Array, value: function(){ return ["one", "two", "three"]} } }, ready: function(){ this.$.template.addEventListener("dom-change", function(event){ console.log(event); }); }, more: function(){ this.push("content", "four"); this.push("content", "five"); } }); </script>
When dom-change fires, I log the event on the console, so open the dev tools and see. Initially, dom-repeat has three iterations and populates dom with three elements. Please note that only one event will fire, namely when all three elements have been added. If you press the button, two more elements will be added to the repeat. As dom-repeat updated asynchronously, these two elements are processed again at a time and raise only one event.
So, the dom-change event is actually the final event you are looking for. It will only start again if you manipulate the elements attached to it.
Maria
source share