diff --git a/browser/IgBlazorSamples.Core/Navigation/BrowserLayout.razor b/browser/IgBlazorSamples.Core/Navigation/BrowserLayout.razor index 481da8e19d..5384b243b3 100644 --- a/browser/IgBlazorSamples.Core/Navigation/BrowserLayout.razor +++ b/browser/IgBlazorSamples.Core/Navigation/BrowserLayout.razor @@ -82,13 +82,18 @@ protected override async Task OnInitializedAsync() @* await SB.CheckUIAsync(NavManager.Uri); StateHasChanged(); *@ await Task.Delay(1); - await JSRuntime.InvokeVoidAsync("attachPreventScroll"); + if (!NavManager.Uri.Contains("/blazor-server")) + { + await JSRuntime.InvokeVoidAsync("attachPreventScroll"); + } } public async ValueTask DisposeAsync() { - await JSRuntime.InvokeVoidAsync("removePreventScroll"); - + if (!NavManager.Uri.Contains("/blazor-server")) + { + await JSRuntime.InvokeVoidAsync("removePreventScroll"); + } } protected bool IsSampleWithNavigation() {