diff --git a/src/shadow-dom.js b/src/shadow-dom.js index ca3f036c..6403fa70 100644 --- a/src/shadow-dom.js +++ b/src/shadow-dom.js @@ -40,6 +40,7 @@ export class PassThroughSlot { renderFallbackContent(view, nodes, projectionSource, index) { if (this.contentView === null) { this.contentView = this.fallbackFactory.create(this.ownerView.container); + this.contentView._isSlotFallback = true; this.contentView.bind(this.ownerView.bindingContext, this.ownerView.overrideContext); let slots = Object.create(null); @@ -277,6 +278,7 @@ export class ShadowSlot { renderFallbackContent(view, nodes, projectionSource, index) { if (this.contentView === null) { this.contentView = this.fallbackFactory.create(this.ownerView.container); + this.contentView._isSlotFallback = true; this.contentView.bind(this.ownerView.bindingContext, this.ownerView.overrideContext); this.contentView.insertNodesBefore(this.anchor); } diff --git a/src/view.js b/src/view.js index fb1af83c..b506cec6 100644 --- a/src/view.js +++ b/src/view.js @@ -88,6 +88,7 @@ export class View { this.viewModelScope = null; this.animatableElement = undefined; this._isUserControlled = false; + this._isSlotFallback = false; this.contentView = null; for (let key in slots) { @@ -166,7 +167,7 @@ export class View { children[i].bind(bindingContext, overrideContext, true); } - if (this.hasSlots) { + if (this.hasSlots && !this._isSlotFallback) { ShadowDOM.distributeView(this.contentView, this.slots); } }