-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Internet Explorer: ViewFactory.create does not clone child template content #569
Comments
Makes sense. Maybe @bigopon wants to work on this? |
Maybe it's more reasonable to wait for someone who actually fought this issue to PR ? I'll be fallback fixer 😄 after few days / a week |
@jdanyow I do not understand how this |
That's intentional, all we do with the content property is call |
where native support is missing fix aurelia/templating#569
The fix should definitely be in |
where native support is missing fix aurelia/templating#569
The
ViewFactory
class is responsible for creating newView
instances. Each time the view factory creates a view it uses the cloneNode method to make a deep clone of a component's html template. The clone is what is ultimately data-bound to the view model instance and attached to the DOM.In Internet Explorer there's an issue with cloning templates that contain other
<template>
elements. Internet Explorer doesn't have true<template>
element support, which means it'scloneNode
logic doesn't clone thecontent: DocumentFragment
property.Here's a plunker that demonstrates how this can cause a stack overflow in Internet Explorer. This issue was originally reported in #460.
One way we could fix this issue is to update ViewFactory.create's cloneNode logic. Here's what that might look like:
plunker
This adds logic to check whether we have true
<template>
element support and lazily polyfilling content property cloning support in individual template instances, on an as-needed basis. When the template does not have any child elements, no polyfilling is needed.@EisenbergEffect could you review this when you get a chance? Several developers have successfully patched their projects with this fix. If this approach looks good I'll continue working on landing this fix or helping someone else take it the rest of the way. This is a good one for learning the templating internals.
The text was updated successfully, but these errors were encountered: