ember-dynamic-component icon indicating copy to clipboard operation
ember-dynamic-component copied to clipboard

The tagName attribute results in an extra wrapping element

Open lolmaus opened this issue 11 years ago • 1 comments

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>

lolmaus avatar Jan 12 '15 11:01 lolmaus

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.

rlivsey avatar Jan 12 '15 14:01 rlivsey