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

Moving a imported-template trigger a reload of the content #20

Closed
ivarbergman opened this issue Jan 21, 2016 · 3 comments
Closed

Moving a imported-template trigger a reload of the content #20

ivarbergman opened this issue Jan 21, 2016 · 3 comments

Comments

@ivarbergman
Copy link

Hi!

I have a situation where I need to move a div to another parent in the DOM.

Polymer.dom(newparent).appendChild(div);

This div contains a imported-template element. And when the div is detached and later attached back to the dom. The imported-template reloads the content by calling _importHTMLImport.

Is there some way that the re-loading of the content could be avoided?

I guess an analogy, would be the script tag. Moving a script tag does not re-evaluate the script.

Cheers!

@tomalec
Copy link
Member

tomalec commented Feb 1, 2016

@warpech we need to decide whether it's a bug/feature/feature that we would liek to change.

I would say it's desired behavior, as it is a convenient way to remove whatever was stamped from it. Detaching imported-template removes also all the stamped nodes. So the analogy is Polymer's dom-bind.

Why would you need to move this element? maybe just to make it easier and cleaner you can just distribute it within Shadow DOM?

The only solution that may somehow fit your need, and our idea of detaching, is that once re-attached imported-template would re-attach its stampedNodes as well, but it may require some time to implement.

@tomalec
Copy link
Member

tomalec commented Jul 4, 2016

I have described my idea at #24.

@ivarbergman Please, take a look it such re-stamping nodes fits your need.

@tomalec
Copy link
Member

tomalec commented Mar 8, 2017

Closing as it's pretty old and stale. Please feel free to re-open if there is anything more.

@tomalec tomalec closed this as completed Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants