Skip to content

Commit

Permalink
Fix #404 in v5
Browse files Browse the repository at this point in the history
  • Loading branch information
vnbaaij committed Nov 12, 2021
1 parent 72df7dd commit a3bda76
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<IsPackable>true</IsPackable>
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<PackageOutputPath>../../packages</PackageOutputPath>
<Version>5.7.5</Version>
<Version>5.7.6</Version>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down
29 changes: 15 additions & 14 deletions src/BlazorFluentUI.CoreComponents/Overlay/Overlay.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.JSInterop;

namespace BlazorFluentUI
{
Expand All @@ -14,26 +15,26 @@ public partial class Overlay : FluentUIComponentBase, IAsyncDisposable
[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }

//protected override async Task OnAfterRenderAsync(bool firstRender)
//{
//if (baseModule == null)
// baseModule = await JSRuntime!.InvokeAsync<IJSObjectReference>("import", BasePath);
//if (firstRender)
//{
// await baseModule!.InvokeVoidAsync("disableBodyScroll");
//}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (baseModule == null)
baseModule = await JSRuntime!.InvokeAsync<IJSObjectReference>("import", BasePath);
if (firstRender)
{
await baseModule!.InvokeVoidAsync("disableBodyScroll");
}

//}
}

public override async ValueTask DisposeAsync()
{
try
{
//if (baseModule != null)
//{
// await baseModule!.InvokeVoidAsync("enableBodyScroll");
// await baseModule.DisposeAsync();
//}
if (baseModule != null)
{
await baseModule!.InvokeVoidAsync("enableBodyScroll");
await baseModule.DisposeAsync();
}

await base.DisposeAsync();
}
Expand Down

0 comments on commit a3bda76

Please sign in to comment.