From 632d11c82ce696859f01bc0451e815f7231bbf3e Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 22 May 2024 16:50:58 +0300 Subject: [PATCH] [develop | DONE | FIXED]: showAuthors.component.ts: On destroy of component, delete all elements with "orcid-dropdown" class from "modal-container". --- utils/authors/showAuthors.component.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/utils/authors/showAuthors.component.ts b/utils/authors/showAuthors.component.ts index a400b722..be0553ff 100644 --- a/utils/authors/showAuthors.component.ts +++ b/utils/authors/showAuthors.component.ts @@ -170,6 +170,17 @@ export class ShowAuthorsComponent { ngOnInit() {} + ngOnDestroy() { + if(this.orcidDropdown && typeof document !== 'undefined') { + let modal_container = document.getElementById("modal-container"); + modal_container.childNodes.forEach(c=> { + if (c['className'] && c['className'].includes("orcid-dropdown")) { + modal_container.removeChild(c); + } + }); + } + } + public onClick() { if (this.modal) { this.modal.cancel();