mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Fix iOS scrolling issue on clone
This commit is contained in:
parent
a49c3a2320
commit
98ee30643a
5
dist/html2canvas.js
vendored
5
dist/html2canvas.js
vendored
@ -1625,6 +1625,11 @@ module.exports = function(ownerDocument, containerDocument, width, height, optio
|
||||
clearInterval(interval);
|
||||
if (options.type === "view") {
|
||||
container.contentWindow.scrollTo(x, y);
|
||||
if ((/(iPad|iPhone|iPod)/g).test(navigator.userAgent) && (container.contentWindow.scrollY !== y || container.contentWindow.scrollX !== x)) {
|
||||
documentClone.documentElement.style.top = (-y) + "px";
|
||||
documentClone.documentElement.style.left = (-x) + "px";
|
||||
documentClone.documentElement.style.position = 'absolute';
|
||||
}
|
||||
}
|
||||
resolve(container);
|
||||
}
|
||||
|
6
dist/html2canvas.min.js
vendored
6
dist/html2canvas.min.js
vendored
File diff suppressed because one or more lines are too long
@ -84,6 +84,11 @@ module.exports = function(ownerDocument, containerDocument, width, height, optio
|
||||
clearInterval(interval);
|
||||
if (options.type === "view") {
|
||||
container.contentWindow.scrollTo(x, y);
|
||||
if ((/(iPad|iPhone|iPod)/g).test(navigator.userAgent) && (container.contentWindow.scrollY !== y || container.contentWindow.scrollX !== x)) {
|
||||
documentClone.documentElement.style.top = (-y) + "px";
|
||||
documentClone.documentElement.style.left = (-x) + "px";
|
||||
documentClone.documentElement.style.position = 'absolute';
|
||||
}
|
||||
}
|
||||
resolve(container);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user