From cfa2e2f8bf40db5c99d2c7e0011e934679d7e2b2 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Tue, 7 Oct 2025 10:24:43 -0400 Subject: [PATCH] Ensure profile modal mounts directly in modal container --- js/ui/profileModalController.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/js/ui/profileModalController.js b/js/ui/profileModalController.js index c7aa76af..6e3006d8 100644 --- a/js/ui/profileModalController.js +++ b/js/ui/profileModalController.js @@ -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();