Skip to content
Merged
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
8 changes: 4 additions & 4 deletions src/Core/Components/Menu/FluentMenu.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
}
}

if (_jsModule is not null)
if (_jsModule is not null && _anchoredRegionModule is not null)
{
await _jsModule.InvokeVoidAsync("initialize", Anchor, Id, Open, _anchoredRegionModule, _dotNetHelper);
}
}
else
{
if (_jsModule is not null && _reinitializeEventListeners)
if (_jsModule is not null && _anchoredRegionModule is not null && _reinitializeEventListeners)
{
// If the menu was closed, remove its set event listeners. If it opened (ie if the menu starts out closed),
// we should set them now.
Expand Down Expand Up @@ -397,13 +397,13 @@ public async ValueTask DisposeAsync()

try
{
if(_jsModule is not null)
if (_jsModule is not null)
{
await _jsModule.InvokeVoidAsync("dispose", Anchor);
await _jsModule.DisposeAsync();
}

if(_anchoredRegionModule is not null)
if (_anchoredRegionModule is not null)
{
await _anchoredRegionModule.DisposeAsync();
}
Expand Down
Loading