Skip to content

Commit

Permalink
Add keep open to menu item (#2852)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikVanHaaren authored Oct 24, 2024
1 parent 456877a commit e29413e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Core/Components/Menu/FluentMenuItem.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public partial class FluentMenuItem : FluentComponentBase, IDisposable
[Parameter]
public bool Checked { get; set; }

/// <summary>
/// Gets or sets a value indicates whether the FluentMenu should remain open after an action.
/// </summary>
[Parameter]
public bool KeepOpen { get; set; }

/// <summary>
/// Gets or sets the content to be rendered inside the component.
/// </summary>
Expand Down Expand Up @@ -78,7 +84,7 @@ protected async Task OnClickHandlerAsync(MouseEventArgs ev)
return;
}

if (Owner != null)
if (Owner != null && !KeepOpen)
{
await Owner.CloseAsync();
}
Expand Down

0 comments on commit e29413e

Please sign in to comment.