[develop | DONE | FIXED]: showAuthors.component.ts: On destroy of component, delete all elements with "orcid-dropdown" class from "modal-container".

This commit is contained in:
Konstantina Galouni 2024-05-22 16:50:58 +03:00
parent 7a517e49ed
commit 632d11c82c
1 changed files with 11 additions and 0 deletions

View File

@ -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();