diff --git a/src/cdk/overlay/overlay.ts b/src/cdk/overlay/overlay.ts index 0f9f0c7a4fe1..18c016236c2a 100644 --- a/src/cdk/overlay/overlay.ts +++ b/src/cdk/overlay/overlay.ts @@ -89,14 +89,15 @@ export function createOverlayRef(injector: Injector, config?: OverlayConfig): Ov ? overlayConfig.positionStrategy?.getPopoverInsertionPoint?.() : null; + // Note: this is redundant since the host will be moved into its final location immediately + // after. We're keeping it as a temporary workaround, because an internal team depends on + // this behavior. We can roll this back after January 5th 2026. + overlayContainer.getContainerElement().appendChild(host); + if (isElement(customInsertionPoint)) { customInsertionPoint.after(host); } else if (customInsertionPoint?.type === 'parent') { customInsertionPoint.element.appendChild(host); - } else { - // Note: leave the container for last so that we fall - // back to it for unsupported/newly-added values. - overlayContainer.getContainerElement().appendChild(host); } return new OverlayRef(