- @_renderContent
+@if (Owner == null || Owner.Expanded || (HasIcon && (!Owner.CollapsedChildNavigation || SubMenu == null)))
+{
+
+ @if (!OnClick.HasDelegate && !string.IsNullOrEmpty(Href))
+ {
+
+
-
-
- }
- else
- {
-
-
-
- @_renderContent
+
+ }
+ else
+ {
+
-
- }
-
+ }
+
+}
+else if (!Owner.Expanded && Owner.CollapsedChildNavigation && SubMenu != null)
+{
+
+
+
+ @ChildContent
+
+
+ @if (Icon is not null)
+ {
+
+
+
+ }
+
+
+}
@code {
private void RenderContent(RenderTreeBuilder __builder)
@@ -44,7 +69,5 @@
@ChildContent
-
-
}
}
diff --git a/src/Core/Components/NavMenu/FluentNavLink.razor.css b/src/Core/Components/NavMenu/FluentNavLink.razor.css
index 974a0f5eb5..1a5624124b 100644
--- a/src/Core/Components/NavMenu/FluentNavLink.razor.css
+++ b/src/Core/Components/NavMenu/FluentNavLink.razor.css
@@ -6,18 +6,17 @@
display: flex;
}
-::deep .fluent-nav-icon {
-
+::deep :not(fluent-menu-item) .fluent-nav-icon {
min-width: 20px;
}
-::deep .fluent-nav-link.disabled {
+::deep :not(fluent-menu-item) .fluent-nav-link.disabled {
color: var(--neutral-fill-secondary-rest) !important;
- cursor: not-allowed ;
+ cursor: not-allowed;
pointer-events: none;
}
-::deep .fluent-nav-link.disabled .fluent-nav-icon {
- fill: var(--neutral-stroke-rest) !important;
-}
+ ::deep :not(fluent-menu-item) .fluent-nav-link.disabled .fluent-nav-icon {
+ fill: var(--neutral-stroke-rest) !important;
+ }
diff --git a/src/Core/Components/NavMenu/FluentNavMenu.razor.cs b/src/Core/Components/NavMenu/FluentNavMenu.razor.cs
index 2c83f4575e..187e7e497b 100644
--- a/src/Core/Components/NavMenu/FluentNavMenu.razor.cs
+++ b/src/Core/Components/NavMenu/FluentNavMenu.razor.cs
@@ -46,6 +46,12 @@ public partial class FluentNavMenu : FluentComponentBase
[Parameter]
public bool Collapsible { get; set; }
+ ///
+ /// Gets or sets whether a menu with all child links is shown for s when the navigation menu is collapsed.
+ ///
+ [Parameter]
+ public bool CollapsedChildNavigation { get; set; } = false;
+
///
[Parameter]
public bool Expanded { get; set; } = true;