Skip to content

bug(DockViewV2): dark/light theme is not applied on initial rendering #7871

@p-picariello

Description

@p-picariello

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

This issue has been observed on my own project, but it's reproducible on the demo site https://www.blazor.zone/dock-view2/row, for example.

The browser is set to dark mode, and the demo site is set to "Auto" or even "Dark". The entire display turns black, which is fine.

Then, navigating to another demo page containing the DockViewV2 component to see the initial rendering is correct: the display is indeed dark... except for the DockViewV2 component!

If a new rendering is triggered, for example, by confirming the site's display is set to "Auto" (or "Dark"), the DockViewV2 component also turns dark. The problem therefore only affects the initial rendering, when the theme is applied via JavaScript before the undocumented Theme parameter of DockViewV2 is taken into account.

It seems that the same problem exists with the DockView component itself.

I tried to work around the problem by using OnAfterRenderAsync or StateHasChanged to force a second render, which would be correct, but it's not effective. In my case, the only solution was to re-declare the CSS variables that determine the colors of the desired theme using the :root {} tag.

Thank you in advance for any help you can provide!

Expected Behavior

Take into account the Theme parameter of the DockViewV2 component from the initial rendering.

Interactive render mode

Interactive Server (Interactive server-side rendering (interactive SSR) using Blazor Server)

Steps To Reproduce

.

Exceptions (if any)

No response

.NET Version

NET9.0

Anything else?

VS 2026 v18.4.3

SDK .NET :
Version: 10.0.201
Commit: 4d3023de60
Workload version: 10.0.200-manifests.121cc9e6
MSBuild version: 18.3.0-release-26153-122+4d3023de6

Environnement d'exécution :
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.201\

Charges de travail .NET installées :
[wasm-tools-net9]
Source de l’installation: VS 18.4.11626.88
Version de manifeste: 10.0.105/10.0.100
Chemin d'accès au Manifeste: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.net9\10.0.105\WorkloadManifest.json
Type d'installation: Msi

[wasm-tools]
Source de l’installation: VS 18.4.11626.88
Version de manifeste: 10.0.105/10.0.100
Chemin d'accès au Manifeste: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.current\10.0.105\WorkloadManifest.json
Type d'installation: Msi

Configuré pour utiliser desworkload sets lors de l’installation de nouveaux manifestes.
Aucun ensemble de charges de travail n’est installé. Exécutez « dotnet workload restore » pour installer un ensemble de charge de travail.

Host:
Version: 10.0.5
Architecture: x64
Commit: a612c2a105

.NET SDKs installed:
9.0.115 [C:\Program Files\dotnet\sdk]
9.0.312 [C:\Program Files\dotnet\sdk]
10.0.201 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
DOTNET_CLI_UI_LANGUAGE [fr-FR]
DOTNET_GCHeapCount [2]
DOTNET_GCNoAffinitize [1]
DOTNET_MULTILEVEL_LOOKUP [0]
DOTNET_TC_CallCountThreshold [1000]
DOTNET_ThreadPool_UnfairSemaphoreSpinLimit [0]
DOTNET_gcConcurrent [0]
Detected COMPlus_* environment variable(s). Consider transitioning to DOTNET_* equivalent.

global.json file:
Not found

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions