From 447d0654e0f06c630ec45e391385b00891490599 Mon Sep 17 00:00:00 2001 From: Chandan-walker Date: Tue, 10 Mar 2026 19:29:22 +0530 Subject: [PATCH] fixed issue of overlay --- apps/proxy-auth/src/app/app.component.ts | 10 +++++----- .../src/app/shadow-dom-overlay-container.ts | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/apps/proxy-auth/src/app/app.component.ts b/apps/proxy-auth/src/app/app.component.ts index 6239c45c..1b1385a6 100644 --- a/apps/proxy-auth/src/app/app.component.ts +++ b/apps/proxy-auth/src/app/app.component.ts @@ -27,16 +27,16 @@ export class AppComponent extends BaseComponent implements OnInit, OnDestroy { if (!environment.production) { const sendOTPConfig = { // referenceId: '4512365m176216342869087ae458e09', - type: 'organization-details', + // type: 'organization-details', // loginRedirectUrl: 'https://www.google.com', // showCompanyDetails: false, authToken: - 'ZVlWU2U4cnlOVUh5M1lYcTZLUUVaczZGdFlHN2lKOXNIU24rTWx3WWpnQzE5YXJVaTF0R215UkEvNGpIS2tJVC83Q01EQlk2QWZ6Z1UxYlQvZCtSeThxdDdiUHVuNm9RbVhPNDVnTFFUN3dKZkRIT294a3BvWFFNSGIxUFV6Wk5yZkpmYXk0MzVmUzlrTXp1bkRYTkRUdzBKMW9yRi8vTDgrak9ESzlKblVXU1hvWCtHSytkaW9nemYxTTFwNEVPSThlNk9ZRXd0YTJUanJqRk1sZUdGUT09', + 'ZGlYV0Z4ekRleUQwZEhXR2JvRllKaWh6cmhhb2hhTnhTMGdDdHlpa2ZaOU9LcGh5M3puLzZ6QTVRb3pGdGNPU0xlSC9SQjI3ckNweWk5cWg1aytpOVRTVmtUWXFRQW5rWEZ0c21KeEN6c0FmK1d5bWQxUk9lZHM4anlHSDI5Q3dxL0o3V0h6Yk9kMDBSVE5pc1FPekJkQVg3QXZ4K2xFbUViUGdhQ0Z6d3hGNXQreEN2dytUQW9GOEdseFFBU3FaNXYzbFVUalJDRitqc0EvQVduQUkrUT09', // type: 'user-management', - isHidden: true, - theme: 'dark', + // isHidden: true, + // theme: 'dark', // isPreview: true, - isLogin: true, + // isLogin: true, target: '_self', success: (data) => { console.log('success response', data); diff --git a/apps/proxy-auth/src/app/shadow-dom-overlay-container.ts b/apps/proxy-auth/src/app/shadow-dom-overlay-container.ts index 4bf509b7..5418e4da 100644 --- a/apps/proxy-auth/src/app/shadow-dom-overlay-container.ts +++ b/apps/proxy-auth/src/app/shadow-dom-overlay-container.ts @@ -20,6 +20,24 @@ export class ShadowDomOverlayContainer extends OverlayContainer { super(document, _platform); } + /** + * Before returning the cached container, check whether it is still + * connected to the live document. This can become false when the client + * application does a SPA navigation that removes the custom + * element (and therefore its shadow root) from the DOM. A new + * element is created by initVerification() on the next + * navigation, but the CDK base class would keep returning the old, + * detached container — causing MatDialog / MatSnackBar to render into an + * invisible node. Clearing _containerElement forces _createContainer() + * to run again and attach the overlay to the new shadow root. + */ + override getContainerElement(): HTMLElement { + if (this._containerElement && !this._containerElement.isConnected) { + this._containerElement = null; + } + return super.getContainerElement(); + } + protected override _createContainer(): void { if (!this._platform.isBrowser) { return;