From 1d27189b1c5449e0dc8cfab06cee5fa7aaedba70 Mon Sep 17 00:00:00 2001 From: MustafaJamalx1 Date: Mon, 18 Aug 2025 08:56:50 +0300 Subject: [PATCH] Fix content injection to clone nodes before appending in injectContentToPrint and createSectionForBaseTable functions --- src/helper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helper.ts b/src/helper.ts index 274b14c..ae3bba4 100644 --- a/src/helper.ts +++ b/src/helper.ts @@ -25,7 +25,7 @@ export function injectContentToPrint( container: HTMLElement, content: HTMLElement ): void { - container.appendChild(content); + container.appendChild(content.cloneNode(true)); } export function waitForRender(timeout: number = 50): Promise { @@ -84,7 +84,7 @@ function createSectionForBaseTable( const tr = document.createElement("tr"); const th = document.createElement("th"); - th.appendChild(content); + th.appendChild(content.cloneNode(true)); tr.appendChild(th); section.appendChild(tr);