Skip to content

Commit

Permalink
fix(vue): popover positioning is now correct with custom elements bui…
Browse files Browse the repository at this point in the history
…ld (#23680)
  • Loading branch information
liamdebeasi authored Jul 26, 2021
1 parent df24c8c commit 3a1a9cb
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion core/src/utils/transition/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Build, writeTask } from '@stencil/core';

import { LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE, LIFECYCLE_WILL_ENTER, LIFECYCLE_WILL_LEAVE } from '../../components/nav/constants';
import { Animation, AnimationBuilder, NavDirection, NavOptions } from '../../interface';
import { componentOnReady } from '../helpers';
import { componentOnReady, raf } from '../helpers';

const iosTransitionAnimation = () => import('./ios.transition');
const mdTransitionAnimation = () => import('./md.transition');
Expand Down Expand Up @@ -205,6 +205,19 @@ export const deepReady = async (el: any | undefined): Promise<void> => {
if (stencilEl != null) {
return;
}

/**
* Custom elements in Stencil will have __registerHost.
*/
} else if (element.__registerHost != null) {
/**
* Non-lazy loaded custom elements need to wait
* one frame for component to be loaded.
*/
const waitForCustomElement = new Promise(resolve => raf(resolve));
await waitForCustomElement;

return;
}
await Promise.all(Array.from(element.children).map(deepReady));
}
Expand Down

0 comments on commit 3a1a9cb

Please sign in to comment.