Template created elements do not upgrade as CE
See original GitHub issueDescription: If you use a template and inject offline AFrame components, these won’t ever be initialized in the live DOM world once appended.
var scene = '<a-scene><a-box color="red" position="0 2 -5" rotation="0 45 45" scale="2 2 2"></a-box></a-scene>';
var template = document.createElement('template'); // use 'div' in Chrome
template.innerHTML = scene;
document.body.appendChild((template.content || template).firstElementChild);
However, if you change template with div, as example, you’ll see that once appended everything is fine.
This makes AFrame component not suitable for any library that creates them via modern template.
Please note this is a Chrome bug only, and I’m not sure if I can fix it via document-register-element polyfill because apparently you are using your own fork.
- A-Frame Version: 0.7.0
- Platform / Device: Chrome (V0 native)
- Reproducible Code Snippet or URL: https://codepen.io/WebReflection/pen/xXMxEO?editors=0010
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (9 by maintainers)
Top Results From Across the Web
Template Change Does Not Update Elements - PI Square
I've implemented a custom data reference and used it in an AF Element Template so that it will be propagated through the AF...
Read more >How do I set the Element Template to NONe via keyin
I have a series of DGN files that have Element Templates set 'AIS_Levels\Rev Cloud\Revision Clouds', so I want to reset them to NONE....
Read more >The Content Template element - HTML - MDN Web Docs
The HTML element is a mechanism for holding HTML that is not to be rendered immediately when a page is loaded but may...
Read more >Development guide for GitLab CI/CD templates
Reviewers might not be able to create the data or configuration that the template requires, so an example project helps the reviewers ensure...
Read more >Use of Template with HTML Custom Elements - Stack Overflow
</slot> to set up the contents of the custom element. You would then have to then include the template code in every HTML...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Migration time has come. https://github.com/aframevr/aframe/pull/4167 moves A-Frame to Custom Elements V1. The old polyfill served as well a new one is also working as expected. Thanks for your help and patience.
Just so you have the feedback - I was bitten by this as well. Jumped in to a-frame, new to the webvr space, but very experienced with web components v1.
Created my project with my normal workflow, created custom elements wrapping a-frame scene, etc…
Nothing worked.
I love a-frame, you guys are doing an amazing job, but v1 is the future, looking forward to when I can use a-frame in the modern web components ecosystem.
Also happy to help with porting.