update window.scroll/scrollTo syntax (#2032)
This commit is contained in:
@@ -1959,9 +1959,9 @@ function removeBoundingBoxes() {
|
|||||||
|
|
||||||
function safeWindowScroll(x, y) {
|
function safeWindowScroll(x, y) {
|
||||||
if (typeof window.scroll === "function") {
|
if (typeof window.scroll === "function") {
|
||||||
window.scroll(x, y, { behavior: "instant" });
|
window.scroll({ left: x, top: y, behavior: "instant" });
|
||||||
} else if (typeof window.scrollTo === "function") {
|
} else if (typeof window.scrollTo === "function") {
|
||||||
window.scrollTo(x, y, { behavior: "instant" });
|
window.scrollTo({ left: x, top: y, behavior: "instant" });
|
||||||
} else {
|
} else {
|
||||||
console.error("window.scroll and window.scrollTo are both not supported");
|
console.error("window.scroll and window.scrollTo are both not supported");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user