We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d511104 commit 4e77bdeCopy full SHA for 4e77bde
.changeset/sixty-tables-fold.md
@@ -0,0 +1,5 @@
1
+---
2
+'svelte': patch
3
4
+
5
+fix: respect the unidirectional nature of time
packages/svelte/src/internal/client/loop.js
@@ -4,10 +4,13 @@ import { raf } from './timing.js';
// TODO move this into timing.js where it probably belongs
6
/**
7
- * @param {number} now
8
* @returns {void}
9
*/
10
-function run_tasks(now) {
+function run_tasks() {
+ // use `raf.now()` instead of the `requestAnimationFrame` callback argument, because
11
+ // otherwise things can get wonky https://github.com/sveltejs/svelte/pull/14541
12
+ const now = raf.now();
13
14
raf.tasks.forEach((task) => {
15
if (!task.c(now)) {
16
raf.tasks.delete(task);
0 commit comments