ember-dynamic-component
ember-dynamic-component copied to clipboard
The tagName attribute results in an extra wrapping element
dynamic-component seems to be able to render required components without wrapping them in an extra element:
<div id="ember515" class="ember-view"> <!-- this is the component -->
<p>Component content</p>
</div>
But when i pass tagName to dynamic component, e. g.
{{dynamic-component
type=model.type
tagName="section" }}
...then an extra wrapper appears:
<section class="ember-view"> <!-- this is extra wrapper -->
<section id="ember515" class="ember-view"> <!-- this is the component -->
<p>Component content</p>
</section>
</section>
Thanks, I'll take a look asap.
The outer wrapper is the container view, which is a virtual metamorph by default. Adding the tagName is being passed to this in addition to the inner component and makes it show up in the DOM.
If you can upgrade to Ember canary then the new {{component}} helper there should also fix this.