Repository navigation
Description
🐛 Bug Report
Opening a normal dialog can briefly display the spinner from the global FluentOverlay, even though the application never calls IDialogService.ShowOverlayAsync().
Setting LibraryConfiguration.UseGlobalOverlay to false removes the flash, confirming that the spinner comes from the global overlay registered by FluentDialogProvider.
💻 Repro or Code Sample
- Register Fluent UI components with the default configuration (where
UseGlobalOverlayistrue). - Add
<FluentProviders />or<FluentDialogProvider />to the application layout. - Open any dialog through
IDialogService, for example:
@inject IDialogService DialogService
<FluentButton OnClick="OpenDialogAsync">Open dialog</FluentButton>
@code {
private async Task OpenDialogAsync()
{
await DialogService.ShowDialogAsync<DialogContent>(new DialogOptions
{
Title = "Test dialog",
});
}
}- Observe that the global overlay spinner is briefly visible while the dialog opens.
The issue disappears with this configuration:
builder.Services.AddFluentUIComponents(options =>
options.UseGlobalOverlay = false);🤔 Expected Behavior
Opening a normal dialog should only display that dialog. The global overlay and its spinner should remain hidden unless the application explicitly calls ShowOverlayAsync().
😯 Current Behavior
The global overlay spinner flashes briefly when a normal dialog opens. The overlay is not intentionally opened and has no visible attribute.
💁 Possible Solution
The behavior appears to result from the interaction of two implementation details:
FluentDialogProviderrendersDialogService.Items.Values.OrderBy(i => i.Index)without an@key. The global overlay hasIndex = long.MaxValue, so it moves from the first rendered position to the last when a regular dialog is added. Blazor can therefore dispose and recreate theFluentOverlaycomponent during the update.FluentOverlay.connectedCallback()defersinitialize()withsetTimeout(..., 0). Until initialization creates the closed shadow-DOM<dialog>, the global overlay's spinner remains visible as light-DOM content.
Preserving dialog identity with a key, or ensuring uninitialized overlay content cannot paint, should prevent the flash.
This is related to #4966, but that issue concerned the component registration/startup path and was closed as fixed by #4932. This report occurs while opening an ordinary dialog after the overlay component has registered.
🔦 Context
The spinner makes normal dialog opening look like an unexpected loading operation. Disabling the global overlay is an effective workaround, but it also prevents applications from using ShowOverlayAsync().
🌍 Your Environment
- OS & Device: Windows PC
- Browser: not yet isolated to a specific browser
- Fluent UI Blazor version: current v5 implementation
Activity
JamesNK commentedon Sep 16, 2026
Confirmed with Playwright against the unmodified local v5 demo at
/Dialogusing the first service-driven Open Dialog example.Instrumentation retained the initial
#global-overlayelement reference, observed child-list mutations inFluentDialogProvider, and sampled the spinner bounds on every animation frame around the click. One click produced this sequence:The old and new overlay DOM objects were different. The native
<dialog>was never open, so this is not an erroneousVisible/ShowOverlayAsync()state transition. It is the light-DOM spinner painting while the recreated custom element waits for deferred initialization.This confirms both parts of the suspected cause: the provider update recreates the unkeyed global overlay, and
connectedCallback()leaves its child content paintable untilinitialize()runs.MarvinKlein1508 commentedon Sep 16, 2026
This could be related to #5187
JamesNK commentedon Sep 16, 2026
Fixed with #5283