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:
@@ -51,6 +51,12 @@ else
|
|||||||
@oncontextmenu="(e) => OnContextMenu(e, item)" @oncontextmenu:preventDefault="@(ContextMenu != null)" @oncontextmenu:stopPropagation="@(ContextMenu != null)">
|
@oncontextmenu="(e) => OnContextMenu(e, item)" @oncontextmenu:preventDefault="@(ContextMenu != null)" @oncontextmenu:stopPropagation="@(ContextMenu != null)">
|
||||||
@if (isBranch)
|
@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"
|
<span class="tv-toggle"
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@@ -59,9 +65,6 @@ else
|
|||||||
@onclick="() => ToggleExpand(key)"
|
@onclick="() => ToggleExpand(key)"
|
||||||
@onclick:stopPropagation
|
@onclick:stopPropagation
|
||||||
@onkeydown="(e) => OnToggleKey(e, key)"
|
@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>
|
@onkeydown:preventDefault><i class="bi bi-chevron-right"></i></span>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user