fix(overlays): check for config contentNode if slot content is undefined
This commit is contained in:
parent
d83f7fc5ce
commit
a4c4f1ee8a
2 changed files with 8 additions and 3 deletions
5
.changeset/shiny-cameras-sparkle.md
Normal file
5
.changeset/shiny-cameras-sparkle.md
Normal 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.
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue