You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have analyzed your use-case and understood the "unexpected behavior". <dom-repeat> reuses element nodes for performance reasons. The assumption that the property layer remains the same throughout the lifecycle of the custom elements thus becomes incorrect. As such, whenever layer changes, in the oberserver you need to update the value of id as well.
You can in the future workaround this issue with using the feature restamp on <dom-repeat>, which is tracked on #1713. Therefore I am closing this issue, feel free to subscribe to #1713.
Description
When i use
<dom-repeat>
, and when i remove item from items, in detached-method use last id.Live Demo
https://codepen.io/anon/pen/ZJEXqB
Steps to Reproduce
Example:
Expected Results
"attached the DOM! - " "0"
"attached the DOM! - " "1"
"attached the DOM! - " "2"
"detached the DOM! - " "0"
Actual Results
"attached the DOM! - " "0"
"attached the DOM! - " "1"
"attached the DOM! - " "2"
"detached the DOM! - " "2"
Browsers Affected
Versions
The text was updated successfully, but these errors were encountered: