fix: await micromorph() to prevent race condition with nav event handlers (#2323)
micromorph() returns Promise<void> 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
| | |
| | | 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) { |