0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

Merge pull request #1990 from sveltejs/gh-1989

fix scroll bindings
This commit is contained in:
Rich Harris 2019-01-18 21:42:39 -05:00 committed by GitHub
commit e8e0f4c8be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -146,9 +146,9 @@ export default class WindowWrapper extends Wrapper {
${scrolling} = true;
clearTimeout(${scrolling_timeout});
window.scrollTo(${
bindings.scrollX ? `current["${bindings.scrollX}"]` : `window.pageXOffset`
bindings.scrollX ? `ctx.${bindings.scrollX}` : `window.pageXOffset`
}, ${
bindings.scrollY ? `current["${bindings.scrollY}"]` : `window.pageYOffset`
bindings.scrollY ? `ctx.${bindings.scrollY}` : `window.pageYOffset`
});
${scrolling_timeout} = setTimeout(${clear_scrolling}, 100);
}

View File

@ -29,7 +29,7 @@ function create_fragment($$, ctx) {
if (changed.y && !scrolling) {
scrolling = true;
clearTimeout(scrolling_timeout);
window.scrollTo(window.pageXOffset, current["y"]);
window.scrollTo(window.pageXOffset, ctx.y);
scrolling_timeout = setTimeout(clear_scrolling, 100);
}