diff --git a/src/lib/components/HeaderFooterLayer.svelte b/src/lib/components/HeaderFooterLayer.svelte index 8cc7872..9ca168e 100644 --- a/src/lib/components/HeaderFooterLayer.svelte +++ b/src/lib/components/HeaderFooterLayer.svelte @@ -337,8 +337,10 @@ content: (zoneDoc(editingIndex, zone, editingVariant) ?? emptyDoc()) as Content, // No autofocus: its scrollIntoView nudges the page so the just-clicked zone // appears to jump. Focus the zone explicitly without scrolling instead. + // Deferred: leaving a zone removes this DOM mid-render, and the blur ProseMirror + // dispatches then would tick state while Svelte is still flushing. onTransaction: () => { - hfTick++; + queueMicrotask(() => hfTick++); }, onUpdate: ({ editor }) => { writeZone(editingIndex, zone, editingVariant, editor.getJSON() as HfDoc);