snapdom icon indicating copy to clipboard operation
snapdom copied to clipboard

BUG: Checkboxes are not rendered in Firefox

Open K1ender opened this issue 2 months ago • 6 comments

When using Zen (Firefox) on this page checkboxes are not rendered when capturing the DOM node

Image

K1ender avatar Oct 27 '25 13:10 K1ender

Good catch! Thank you

tinchox5 avatar Oct 27 '25 14:10 tinchox5

@K1ender This kind of issues are very tricky, mostly happens on Safari but there are exceptions. The hard part is that snapdom correctly captures the element and its check boxes. If you open the captured element in a new tab, it will be show that all inputs are rendered ok.

tinchox5 avatar Nov 01 '25 20:11 tinchox5

I'm afraid in this particular case, is a firefox limitation. I will try to explain... it seems that if the serialized svg (what snapdom core generates) is used as image, some elements are to correctly rendered. When you show the image in a new tab, firefox handles it as a SVG document and all is rendered ok.

tinchox5 avatar Nov 01 '25 20:11 tinchox5

For some reason, html2canvas doesn’t have this issue

K1ender avatar Nov 01 '25 21:11 K1ender

Because it has a different its approach. It doesn't use foreign-object as a default. However, I don't know the details since snapdom isn't a html2canvas fork

tinchox5 avatar Nov 01 '25 21:11 tinchox5

What I can try is to recreate those inputs as standard html but keeping its styles in case Firefox is used. I will work in a plugin to check it and if works I will add in the core

tinchox5 avatar Nov 01 '25 21:11 tinchox5