From b05842c59bf6f683529fae1cda84f26e87623178 Mon Sep 17 00:00:00 2001 From: Johan van Eck Date: Wed, 12 Jun 2019 21:02:03 +0200 Subject: [PATCH] Make sure requestAnimationFrame has the correct context when triggered --- src/runtime/internal/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/internal/utils.ts b/src/runtime/internal/utils.ts index 152c0e79b0..c961768eb0 100644 --- a/src/runtime/internal/utils.ts +++ b/src/runtime/internal/utils.ts @@ -96,7 +96,7 @@ export let now: () => number = is_client ? () => window.performance.now() : () => Date.now(); -export let raf = is_client ? requestAnimationFrame : noop; +export let raf = is_client ? requestAnimationFrame.bind(window) : noop; // used internally for testing export function set_now(fn) {