-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[0.8] x-repeat failing to stamp instances on safari #1443
Comments
Looks like a safari native template bug with importing template content containing nested templates... nested templates lose their content. http://jsbin.com/siliwarete/1/edit?html,console For all polymer templates, the annotator recursively scans template contents and removes the As a short-term workaround, you could probably use a Do you want to move this issue to https://github.com/PolymerElements/test-fixture and decide how to handle it there? |
Wow that's a hell of a bug. Thanks for tracking it down! Yeah, it doesn't look like there's much we can do on the Polymer side here (except maybe warn when encountering it) |
I'd also faced the Safari (and IE) problem with nested templates and preserve-content. I tried to workaround the issue by copying template node.content to dom node._content after importNode in instanceTemplate (see https://github.com/TangereJs/Tangere/blob/0.8-preview/Tangere.html) That fixed my use case - but I've no idea if that could also fix for this issue. |
@IntranetFactory What problem was that solving? Seems that moving |
In my use case the .content of nested template nodes, marked with preserve-content are empty in Safari and IE. In Chrome and FF .content contains the template. The .content was "lost" in document.importNode. In template .content exists, but in the dom variable it was missing only in Safari and IE. In Safari I assumed it's known bug of nested templates, and in IE probably the polyfill fails. It seemed like importNode "forgets" to copy .content when creating the document fragment. So my workaround is to copy the original template.content to the imported dom created by document.importNode. So instanceTemplate then returns all template nodes with .content populated in all browsers. |
Ah, got it. |
Issue should be moved to text-fixture and that element will need to deal with the Safari issue. It could leverage |
auto-moving this issue to PolymerElements/test-fixture#8 and closing this one |
I've gone pretty far down the rabbit hole, but I think it's time to pass off to you @kevinpschaaf
To see the weirdness:
iron-selector
'sbehaviors
branchtest/template-repeat.html
, I'd just focus on the'supports repeated items'
test.Notice that:
items
, the template properly debounces and callsrender
.render
, it is properly calling_insertRow
->_generateRow
->stamp
stamp
is a completely busted row (missing node/fragment, no children)The text was updated successfully, but these errors were encountered: