You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are testing using the non-minified version of html2canvas and checked any potential issues reported in the console
Bug reports:
If you change an element's value in the desired section to screenshot, then press a button to call the html2canvas function, the screenshot will be the old value.
neither
var ae = document.activeElement;
ae.setAttribute("value", ae.value + ae.getAttribute("data-text"));
or
document.activeElement.blur();
before calling so that the focus is changed in an attempt to sync the value attribute to the value property does not prevent this issue.
Specifications:
html2canvas version tested with: 1.4.1.min
Browser & version: firefox 124.0.2 64-bit & safari on iphone
Operating system: Windows 11, IOS 17
The text was updated successfully, but these errors were encountered:
I was using the canvas.todataurl string as data to submit, then processing/converting/saving without ever actually putting the canvas on the page anywhere. appendchild(canvas) screenshotdata = canvas.todaturl(), then removechild(canvas) fixes it, with in my edge case because there were so many many elements its cloning, it is also a timing issue, async then await the function to generate screenshot, await the canvas creation, then submit the data was also required
(
async function getSS() {
if(o('TEST')!=null) document.body.removeChild(o('TEST'));
await html2canvas(document.body).then(
function (c) {
c.id="TEST";
document.body.appendChild(c);
});
o('screenshotData').value = o('TEST').toDataURL();
document.body.removeChild(o('TEST'));
return true;
}
////---later
async function SubmitNotes(e) {
e.preventDefault();
await getSS();
EDIT: o() is sort of my fingerprint, you see it in almost every single javascript thing I do, sorry, for reference: function o(obj) { return document.getElementById(obj); }
Please follow the general troubleshooting steps first:
Bug reports:
If you change an element's value in the desired section to screenshot, then press a button to call the html2canvas function, the screenshot will be the old value.
neither
var ae = document.activeElement;
ae.setAttribute("value", ae.value + ae.getAttribute("data-text"));
or
document.activeElement.blur();
before calling so that the focus is changed in an attempt to sync the value attribute to the value property does not prevent this issue.
Specifications:
The text was updated successfully, but these errors were encountered: