eKoopmans / html2pdf.js

Client-side HTML-to-PDF rendering using pure JS.
MIT License
3.92k stars 1.37k forks source link

Checkbox states unexpectedly changing to "on" when generating PDF with html2pdf.js #682

Closed devAbreu closed 4 months ago

devAbreu commented 4 months ago

I'm encountering an issue with my React component where checkbox states in my original HTML are changing to "on" when I attempt to generate a PDF using html2pdf.js. This problem occurs even though the checkboxes are not directly involved in the PDF generation process (i.e., they are not included in the PDF). It seems that the act of preparing the HTML for PDF conversion somehow affects the checkbox states in the original document.

Steps to Reproduce

  1. Clone or manipulate HTML content in a React component to prepare for PDF generation.
  2. Use html2pdf.js to generate a PDF from the manipulated content.
  3. Observe that checkboxes in the original HTML content (not the cloned/manipulated content for PDF generation) change their state to "on".

Expected Behavior

The checkboxes in the original HTML should remain unaffected by the PDF generation process. Their states should not change to "on" or any other state unless explicitly modified by the user or other processes.

Actual Behavior

Checkboxes in the original HTML content are unexpectedly changing their state to "on" during the PDF generation process, despite not being included or directly manipulated for inclusion in the PDF.

Attempts to Resolve

Ensured that all manipulations (e.g., cloning elements, changing input types) are performed on cloned versions of the original DOM elements, not the originals themselves. Verified that the issue persists even without direct interaction or manipulation of the checkboxes for PDF generation purposes.

Additional Context

devAbreu commented 4 months ago

The fault, was on my side. Not html2pdf.js. I proceed to close this issue.