Merge pull request #1847 from PR0M3TH3AN/fix-upload-modal-test-15043512839358145269

Fix UploadModal DOM initialization for robust testing
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-01-27 16:28:40 -05:00
commit f9dd9d7920
1 file changed
+5 -5
+5 -5
View File
@@ -160,11 +160,11 @@ export class UploadModal {
wrapper.innerHTML = html;
this.removeTrackingScripts(wrapper);
targetContainer.appendChild(wrapper.firstElementChild);
this.root = targetContainer.querySelector("#uploadModal");
if (!this.root && targetContainer.lastElementChild && targetContainer.lastElementChild.id === "uploadModal") {
this.root = targetContainer.lastElementChild;
}
const modalRoot = wrapper.querySelector("#uploadModal");
if (!modalRoot) throw new Error("UploadModal template must contain #uploadModal element");
targetContainer.appendChild(modalRoot);
this.root = modalRoot;
this.container = targetContainer;
this.cacheElements();