fix(overlays): check for config contentNode if slot content is undefined

This commit is contained in:
Joren Broekema 2020-10-08 15:39:32 +02:00
parent d83f7fc5ce
commit a4c4f1ee8a
2 changed files with 8 additions and 3 deletions

View file

@ -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.

View file

@ -183,9 +183,9 @@ export const OverlayMixinImplementation = superclass =>
get _overlayContentNode() { get _overlayContentNode() {
if (!this._cachedOverlayContentNode) { if (!this._cachedOverlayContentNode) {
this._cachedOverlayContentNode = Array.from(this.children).find( this._cachedOverlayContentNode =
child => child.slot === 'content', Array.from(this.children).find(child => child.slot === 'content') ||
); this.config.contentNode;
} }
return this._cachedOverlayContentNode; return this._cachedOverlayContentNode;
} }