Skip to content

Commit

Permalink
Add a check to disable prevent scroll logic for blazor server (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
mddragnev authored Jan 16, 2024
1 parent b459c2c commit ee0da03
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions browser/IgBlazorSamples.Core/Navigation/BrowserLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit ee0da03

Please sign in to comment.