feat(loading): use loading overlay inline (#26153)

This commit is contained in:
Sean Perkins
2022-10-24 16:49:17 -04:00
committed by GitHub
parent d1fb7b039b
commit 34ca337b8a
13 changed files with 536 additions and 15 deletions

View File

@@ -53,6 +53,8 @@ export const CoreDelegate = () => {
userComponentProps: any = {},
cssClasses: string[] = []
) => {
const hasUserDefinedComponent = userComponent !== undefined;
BaseComponent = parentElement;
/**
* If passing in a component via the `component` props
@@ -86,7 +88,7 @@ export const CoreDelegate = () => {
BaseComponent.appendChild(el);
await new Promise((resolve) => componentOnReady(el, resolve));
} else if (BaseComponent.children.length > 0) {
} else if (hasUserDefinedComponent && BaseComponent.children.length > 0) {
// If there is no component, then we need to create a new parent
// element to apply the css classes to.
const el = BaseComponent.ownerDocument?.createElement('div');