fix scroll bindings

pull/1990/head
Richard Harris 6 years ago
parent 4d262c4d96
commit 8c3f652a01

@ -146,9 +146,9 @@ export default class WindowWrapper extends Wrapper {
${scrolling} = true; ${scrolling} = true;
clearTimeout(${scrolling_timeout}); clearTimeout(${scrolling_timeout});
window.scrollTo(${ 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); ${scrolling_timeout} = setTimeout(${clear_scrolling}, 100);
} }

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

Loading…
Cancel
Save