fix(centralui): move TreeView toggle comment outside start tag — mid-attribute Razor comment crashed render (InvalidCharacterError → circuit teardown on branch-node trees) (INT)

This commit is contained in:
Joseph Doherty
2026-06-18 20:44:04 -04:00
parent 8270a603d3
commit 4369da61c1
@@ -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). *@
<span class="tv-toggle"
role="button"
tabindex="0"
@@ -59,9 +65,6 @@ else
@onclick="() => ToggleExpand(key)"
@onclick:stopPropagation
@onkeydown="(e) => OnToggleKey(e, key)"
@* preventDefault 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. *@
@onkeydown:preventDefault><i class="bi bi-chevron-right"></i></span>
}
else