From 4369da61c1e59dcf92611166bb7d630321aac884 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 18 Jun 2026 20:44:04 -0400 Subject: [PATCH] =?UTF-8?q?fix(centralui):=20move=20TreeView=20toggle=20co?= =?UTF-8?q?mment=20outside=20start=20tag=20=E2=80=94=20mid-attribute=20Raz?= =?UTF-8?q?or=20comment=20crashed=20render=20(InvalidCharacterError=20?= =?UTF-8?q?=E2=86=92=20circuit=20teardown=20on=20branch-node=20trees)=20(I?= =?UTF-8?q?NT)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Shared/TreeView.razor | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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