Checkbox states unexpectedly changing to "on" when generating PDF with html2pdf.js
devAbreu opened this issue · 1 comments
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
- Clone or manipulate HTML content in a React component to prepare for PDF generation.
- Use html2pdf.js to generate a PDF from the manipulated content.
- 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
- React version: 17.0.2
- html2pdf.js version: 0.9.0
- Browsers tested: Mozilla, Chrome, Edge
The fault, was on my side. Not html2pdf.js. I proceed to close this issue.