Skip to content
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

iron-list doesn't restore template when element gets recycled #274

Open
3 tasks done
ronnyroeller opened this issue Jul 3, 2016 · 2 comments
Open
3 tasks done

iron-list doesn't restore template when element gets recycled #274

ronnyroeller opened this issue Jul 3, 2016 · 2 comments

Comments

@ronnyroeller
Copy link
Contributor

Description

I use iron-swipeable-container in an iron-list. Swiping an item removes the DOM node within the iron-list entry. Setting afterwards new data fails to restore the deleted DOM node.

This does work with dom-repeat (see live demo: https://jsbin.com/cakizohagu/edit?html,output).

Expected outcome

DOM node should be restored according to the template in the iron-list.

Actual outcome

Data isn't visible (since the entry in the list doesn't have any longer the DOM node to show the data).

Live Demo

https://jsbin.com/cakizohagu/edit?html,output

Steps:

  1. Open live demo
  2. Swipe away item "B" from the first block (iron-list)
    => Now item "C" isn't any longer visible in the iron-list (but still visible in the dom-repeat list)
  3. Click on button "Reset items"
    => Item "B" is still not visible in iron-list (but is correctly visible in dom-repeat list)

Steps to reproduce

See JSBin

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
@ronnyroeller
Copy link
Contributor Author

This issue looks similar to #257

@ronnyroeller ronnyroeller changed the title iron-list doesn't restore template on data change iron-list doesn't restore template when element gets recycled Jul 3, 2016
@blasten
Copy link
Contributor

blasten commented Jul 6, 2016

Yes, it's the same issue. In this case, iron-swipeable-container removes the element from the light DOM. https://github.com/PolymerElements/iron-swipeable-container/blob/master/iron-swipeable-container.html#L257

Because the DOM was removed dynamically, those nodes can't be recycled, but iron-list is not aware of those changes. I wonder if iron-swipeable-container could trigger an event when it's about to remove the DOM and do nothing if the event is defaultPrevented. That way we could fix this issue. cc @notwaldorf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants