Ensure profile modal mounts directly in modal container

This commit is contained in:
thePR0M3TH3AN committed 2025-10-07 10:24:43 -04:00
1 parent ee2175a7ad
commit cfa2e2f8bf
1 file changed
+11 -4
+11 -4
View File
@@ -446,10 +446,17 @@ export class ProfileModalController {
}
const html = await response.text();
const wrapper = document.createElement("div");
wrapper.innerHTML = html;
this.removeTrackingScripts(wrapper);
this.modalContainer.appendChild(wrapper);
const template = document.createElement("template");
template.innerHTML = html;
this.removeTrackingScripts(template.content);
const modalRoot = template.content.querySelector("#profileModal");
if (!(modalRoot instanceof HTMLElement)) {
throw new Error("profile modal markup missing expected #profileModal root");
}
this.modalContainer.appendChild(template.content);
this.profileModal = modalRoot;
this.cacheDomReferences();
this.registerEventListeners();