Polymer 3 slot fallback content always gets rendered regardless of it being overwritten in host element

Viewed 46

When creating a slot in Polymer 3 I have noticed that the fallback content is always attached to the DOM and rendered regardless if another element was passed into the slot. For example:

Suppose we have my-custom-element in polymer 3 that inside contains a slot as follows

 <slot name="slot-content">
       <my-second-custom-element></my-second-custom-element>
 </slot>

Now if I use it like so:

 <my-custom-element>
      <my-third-custom-element slot="slot-content"></my-third-custom-element>
 </my-custom-element>

What I'm seeing is that the ready function will be called in my-second-custom-element and then in the my-third-custom-element. Since I am overriding the fallback content in the slot, I would believe the second custom element should never exist in the DOM or have its ready function called.

0 Answers
Related