Skip to content
Merged
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
17 changes: 13 additions & 4 deletions src/Core/Components/List/FluentCombobox.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,20 @@ protected override async Task ChangeHandlerAsync(ChangeEventArgs e)

public new async ValueTask DisposeAsync()
{
if (Module is not null && !string.IsNullOrEmpty(Id))
try
{
await Module.InvokeVoidAsync("detachIndicatorClickHandler", Id);
await Module.DisposeAsync();
if (Module is not null && !string.IsNullOrEmpty(Id))
{
await Module.InvokeVoidAsync("detachIndicatorClickHandler", Id);
await Module.DisposeAsync();
}
await base.DisposeAsync();
}
catch (Exception ex) when (ex is JSDisconnectedException ||
ex is OperationCanceledException)
{
// The JSRuntime side may routinely be gone already if the reason we're disposing is that
// the client disconnected. This is not an error.
}
await base.DisposeAsync();
}
}
16 changes: 13 additions & 3 deletions src/Core/Components/Overlay/FluentOverlay.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,21 @@ private async Task OnCloseInternalHandlerAsync(MouseEventArgs e)
/// <returns></returns>
public async ValueTask DisposeAsync()
{
await InvokeOverlayDisposeAsync();
try
{
await InvokeOverlayDisposeAsync();

if (_jsModule != null)
{
await _jsModule.DisposeAsync();
}

if (_jsModule != null)
}
catch (Exception ex) when (ex is JSDisconnectedException ||
ex is OperationCanceledException)
{
await _jsModule.DisposeAsync();
// The JSRuntime side may routinely be gone already if the reason we're disposing is that
// the client disconnected. This is not an error.
}

GlobalState.OnChange -= UpdateNeutralColor;
Expand Down
Loading