Skip to content
This repository was archived by the owner on Dec 26, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Blazored.Modal/Blazored.Modal.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

Expand Down
9 changes: 8 additions & 1 deletion src/Blazored.Modal/BlazoredModal.razor
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@
_haveActiveModals = false;
if (_styleFunctions is not null)
{
await _styleFunctions.InvokeVoidAsync("removeBodyStyle");
try
{
await _styleFunctions.InvokeVoidAsync("removeBodyStyle");
}
catch (ObjectDisposedException)
{
// If the we're working in hybrid scenario for Blazor Web App, where JsRuntime is not available, we don't need to do anything
}
}
}

Expand Down