Saulis / iron-data-table

iron-data-table is a Web Component for displaying data as a table or grid. Built on top of iron-list using Polymer.
Apache License 2.0
147 stars 66 forks source link

Re-adding custom element with iron-data-table on the same parent #191

Open miklosbarabas opened 7 years ago

miklosbarabas commented 7 years ago

There's a custom element that has an iron-data-data, using it's items attribute and 2-way-binding {{}} from iron-ajax. After lazy-importing the element and adding the new element as a child to a parent node, everything works as it should.

In my case the user navigates to another view, therefore I remove this custom element from its parent node. When the user comes back to that view, I lazy-import the element again (polymer detects that it's already there) and add it again to the same previous parent node. After that the new content gets loaded into the iron-data-table (as previously did), but right after that somehow the previous data is loaded back again. (this change is fast, user only experience the previous data in the table)

This is only experienced if not using iron-ajax's auto, instead invoking it with the generateRequest() method. Until calling this.$.ironAjaxId.generateRequest() for the first time in the custom element, everything is working as expected.

miklosbarabas commented 7 years ago

What I have found so far is that data-table-templatizer-behavior.html has a method called _forwardParentProp and if I comment the body of that method out, the issue mentioned in the description is not happening.