diff --git a/packages/blazor-workspace/NimbleBlazor/wwwroot/NimbleBlazor.lib.module.js b/packages/blazor-workspace/NimbleBlazor/wwwroot/NimbleBlazor.lib.module.js index ae32235cea..4f6cf5cee8 100644 --- a/packages/blazor-workspace/NimbleBlazor/wwwroot/NimbleBlazor.lib.module.js +++ b/packages/blazor-workspace/NimbleBlazor/wwwroot/NimbleBlazor.lib.module.js @@ -163,6 +163,12 @@ function registerNimbleEvents(Blazor) { }); } +function handleRuntimeStarted() { + window.requestAnimationFrame(() => { + window.NimbleBlazor.hasRuntimeStarted = true; + }); +} + // Blazor Web Apps export function afterWebStarted(Blazor) { registerNimbleEvents(Blazor); @@ -171,11 +177,11 @@ export function afterWebStarted(Blazor) { } export function afterServerStarted(_Blazor) { - window.NimbleBlazor.hasRuntimeStarted = true; + handleRuntimeStarted(); } export function afterWebAssemblyStarted(_Blazor) { - window.NimbleBlazor.hasRuntimeStarted = true; + handleRuntimeStarted(); } // Blazor Server/WebAssembly/Hybrid apps @@ -186,7 +192,7 @@ export function afterStarted(Blazor) { registerNimbleEvents(Blazor); } - window.NimbleBlazor.hasRuntimeStarted = true; + handleRuntimeStarted(); } if (window.NimbleBlazor) { diff --git a/packages/blazor-workspace/SprightBlazor/wwwroot/SprightBlazor.lib.module.js b/packages/blazor-workspace/SprightBlazor/wwwroot/SprightBlazor.lib.module.js index 4989ccf2b2..3e41a1d69d 100644 --- a/packages/blazor-workspace/SprightBlazor/wwwroot/SprightBlazor.lib.module.js +++ b/packages/blazor-workspace/SprightBlazor/wwwroot/SprightBlazor.lib.module.js @@ -34,6 +34,12 @@ export function registerSprightEvents(Blazor) { */ } +function handleRuntimeStarted() { + window.requestAnimationFrame(() => { + window.NimbleBlazor.hasRuntimeStarted = true; + }); +} + // Blazor Web Apps export function afterWebStarted(Blazor) { registerSprightEvents(Blazor); @@ -42,11 +48,11 @@ export function afterWebStarted(Blazor) { } export function afterServerStarted(_Blazor) { - window.SprightBlazor.hasRuntimeStarted = true; + handleRuntimeStarted(); } export function afterWebAssemblyStarted(_Blazor) { - window.SprightBlazor.hasRuntimeStarted = true; + handleRuntimeStarted(); } // Blazor Server/WebAssembly/Hybrid apps @@ -57,7 +63,7 @@ export function afterStarted(Blazor) { registerSprightEvents(Blazor); } - window.NimbleBlazor.hasRuntimeStarted = true; + handleRuntimeStarted(); } if (window.SprightBlazor) {