bail if value is undefined

pull/11469/head
Rich Harris 2 years ago
parent b296bb048c
commit 487c55ae88

@ -32,7 +32,9 @@ export function bind_window_scroll(type, get_value, update) {
};
render_effect(() => {
latest_value = (get_value() ?? window[is_scrolling_x ? 'scrollX' : 'scrollY']) || 0;
latest_value = get_value();
if (latest_value === undefined) return;
if (!scrolling) {
scrolling = true;
clearTimeout(timeout);

Loading…
Cancel
Save