Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow OnCustomAction on NavMenuGroup #523

Closed
mrpmorris opened this issue Jul 12, 2023 · 0 comments
Closed

feat: Allow OnCustomAction on NavMenuGroup #523

mrpmorris opened this issue Jul 12, 2023 · 0 comments

Comments

@mrpmorris
Copy link
Contributor

Scenario: NavMenu is collapsed, user selects a group

The correct default behaviour is for the nav menu to expand and the group to appear expanded. My requirement is that a popup menu should appear instead.

Proposal:
Add a callback to FluentNavMenuGroup EventCallback<FluentNavMenuGroupSelectingArgs> OnSelecting

Ordinarily, the group is not selectable if it doesn't have a value set in its Href parameter. This would be changed so that it is selectable if Href is set, or OnSelecting is set.

The args classes would be

public class ....EventArgs : EventArgs
{
  public FluentNavMenuGroup Group { get; }
  public bool Cancelled { get; }
  public void Cancel()
  {
    Cancelled = true;
  }
}

where Cancelled would default to true if the group had no Href.

This would allow the user to add an OnSelecting action to the group, handle it with a custom action, and then cancel the original navigation if appropriate.

If executing OnCustomAction calls Cancel then the item will not be selected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants