diff --git a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor index f5df349b..b46c3655 100644 --- a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor +++ b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor @@ -51,6 +51,12 @@ else @oncontextmenu="(e) => OnContextMenu(e, item)" @oncontextmenu:preventDefault="@(ContextMenu != null)" @oncontextmenu:stopPropagation="@(ContextMenu != null)"> @if (isBranch) { + @* preventDefault on the toggle's keydown suppresses Space-bar page scroll on activation + (intended for a role=button). It also suppresses Arrow-key default scroll while the toggle + itself has focus — acceptable, as the chevron is Tab-navigated and Blazor offers no per-key + conditional preventDefault. This comment MUST stay OUTSIDE the start tag: a Razor comment + placed between attributes is emitted as an invalid attribute name and crashes the render + (InvalidCharacterError → circuit teardown on any tree with branch nodes). *@ } else