🐛 Bug Report
When using NimbleAnchorTreeItem in a NimbleTreeView in a Blazor project, enhanced navigation (same-document navigation without a full navigate/ page reload) will not work. (NimbleAnchorTreeItem will always trigger a full navigate/ page reload, when activated.)
💻 Repro or Code Sample
BlazorAnchorTreeItemDemo.zip
See test project above. The Nimble Tree is at the top of the left pane, and navigating with that will trigger reloads (you'll see the nav pane flicker/refresh), whereas using the anchors/links further down will not reload.
🤔 Expected Behavior
NimbleAnchorTreeItem should support enhanced navigation (without full reload). Other controls like NimbleAnchor / NimbleAnchorButton do support that scenario already.
😯 Current Behavior
NimbleAnchorTreeItem triggers a full navigation/reload.
Workaround
Currently, if someone requires a Nimble tree + enhanced navigation, they can use NimbleTreeItem with registered onclick / onkeydown (for Enter key) handlers, which use the Blazor NavigationManager.NavigateTo() API to navigate.
Additional discussion
Blazor has page-level click interception logic to support enhanced navigation. See NavigationUtils in ASP.NET Core source, which no-ops if the click event had preventDefault() called. There's also EventDelegator.dispatchGlobalEventToAllElements which will stop going up the chain looking for an event target if stopPropagation happened.
The Nimble AnchorTreeItem clickHandler does stopPropagation, so that seems to cause the problem.
(To confirm, in DevTools if you unhook that event handler from the tree item at runtime, you do get the enhanced navigation behavior.)
🐛 Bug Report
When using
NimbleAnchorTreeItemin aNimbleTreeViewin a Blazor project, enhanced navigation (same-document navigation without a full navigate/ page reload) will not work. (NimbleAnchorTreeItemwill always trigger a full navigate/ page reload, when activated.)💻 Repro or Code Sample
BlazorAnchorTreeItemDemo.zip
See test project above. The Nimble Tree is at the top of the left pane, and navigating with that will trigger reloads (you'll see the nav pane flicker/refresh), whereas using the anchors/links further down will not reload.
🤔 Expected Behavior
NimbleAnchorTreeItemshould support enhanced navigation (without full reload). Other controls likeNimbleAnchor/NimbleAnchorButtondo support that scenario already.😯 Current Behavior
NimbleAnchorTreeItemtriggers a full navigation/reload.Workaround
Currently, if someone requires a Nimble tree + enhanced navigation, they can use
NimbleTreeItemwith registeredonclick/onkeydown(for Enter key) handlers, which use the BlazorNavigationManager.NavigateTo()API to navigate.Additional discussion
Blazor has page-level click interception logic to support enhanced navigation. See NavigationUtils in ASP.NET Core source, which no-ops if the click event had
preventDefault()called. There's also EventDelegator.dispatchGlobalEventToAllElements which will stop going up the chain looking for an event target if stopPropagation happened.The Nimble AnchorTreeItem clickHandler does stopPropagation, so that seems to cause the problem.
(To confirm, in DevTools if you unhook that event handler from the tree item at runtime, you do get the enhanced navigation behavior.)