From dd2f844b2a8f582a389f138b14cfd1b1f45f69f7 Mon Sep 17 00:00:00 2001 From: "Andrew G. Dunn" Date: Sun, 1 Mar 2026 22:27:59 -0500 Subject: [PATCH] fix: await micromorph() to prevent race condition with nav event handlers micromorph() returns Promise because its internal patch() function is async and uses Promise.all for recursive child patching. Without await, the DOM morph may still be in progress when the nav event fires and downstream handlers attempt to rebuild dynamic content. Fixes #2322 --- quartz/components/scripts/spa.inline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quartz/components/scripts/spa.inline.ts b/quartz/components/scripts/spa.inline.ts index 2898dc419..465e79315 100644 --- a/quartz/components/scripts/spa.inline.ts +++ b/quartz/components/scripts/spa.inline.ts @@ -102,7 +102,7 @@ async function _navigate(url: URL, isBack: boolean = false) { html.body.appendChild(announcer) // morph body - micromorph(document.body, html.body) + await micromorph(document.body, html.body) // scroll into place and add history if (!isBack) {