diff --git a/.changeset/shiny-cameras-sparkle.md b/.changeset/shiny-cameras-sparkle.md new file mode 100644 index 000000000..e7f3dc2f9 --- /dev/null +++ b/.changeset/shiny-cameras-sparkle.md @@ -0,0 +1,5 @@ +--- +'@lion/overlays': patch +--- + +If a content slot cannot be found, OverlayMixin should check if there is a contentNode imperatively passed through the config. diff --git a/packages/overlays/src/OverlayMixin.js b/packages/overlays/src/OverlayMixin.js index 39f528fa3..f656ab722 100644 --- a/packages/overlays/src/OverlayMixin.js +++ b/packages/overlays/src/OverlayMixin.js @@ -183,9 +183,9 @@ export const OverlayMixinImplementation = superclass => get _overlayContentNode() { if (!this._cachedOverlayContentNode) { - this._cachedOverlayContentNode = Array.from(this.children).find( - child => child.slot === 'content', - ); + this._cachedOverlayContentNode = + Array.from(this.children).find(child => child.slot === 'content') || + this.config.contentNode; } return this._cachedOverlayContentNode; }