mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(popover): popover can now be used inline (#23231)
BREAKING CHANGE: Converted `ion-popover` to use the Shadow DOM.
This commit is contained in:
@@ -5,14 +5,15 @@ import { componentOnReady } from './helpers';
|
||||
export const attachComponent = async (
|
||||
delegate: FrameworkDelegate | undefined,
|
||||
container: Element,
|
||||
component: ComponentRef,
|
||||
component?: ComponentRef,
|
||||
cssClasses?: string[],
|
||||
componentProps?: { [key: string]: any }
|
||||
componentProps?: { [key: string]: any },
|
||||
inline?: boolean
|
||||
): Promise<HTMLElement> => {
|
||||
if (delegate) {
|
||||
return delegate.attachViewToDom(container, component, componentProps, cssClasses);
|
||||
}
|
||||
if (typeof component !== 'string' && !(component instanceof HTMLElement)) {
|
||||
if (!inline && typeof component !== 'string' && !(component instanceof HTMLElement)) {
|
||||
throw new Error('framework delegate is missing');
|
||||
}
|
||||
|
||||
@@ -28,6 +29,7 @@ export const attachComponent = async (
|
||||
}
|
||||
|
||||
container.appendChild(el);
|
||||
|
||||
await new Promise(resolve => componentOnReady(el, resolve));
|
||||
|
||||
return el;
|
||||
|
||||
Reference in New Issue
Block a user