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

fix: The OnClick event in FluentMenuItem does not function when it is an item within a FluentMenuButton. #2780

Closed
aminmashayekhi opened this issue Oct 8, 2024 · 1 comment
Assignees
Labels
status:in-progress Work is in progress

Comments

@aminmashayekhi
Copy link

🐛 Bug Report

When FluentMenuItem is nested within FluentMenuButton, its OnClick event is not triggered.

💻 Repro or Code Sample

<FluentMenuButton ButtonAppearance="Appearance.Stealth" Text="File" >
    <FluentMenuItem Id="itmAccCodeList" OnClick="@((e) => itmAccCodeList_Click(e))" >AccCode List</FluentMenuItem>
</FluentMenuButton>

@code {
    private void itmAccCodeList_Click(MouseEventArgs e)
    {
        // Do somthing like:
        Console.WriteLine("Worked!");
    }
}

🤔 Expected Behavior

The itmAccCodeList_Click event is triggered when a FluentMenuItem is clicked.

😯 Current Behavior

No action occurred when it is a child of FluentMenuButton.

@microsoft-github-policy-service microsoft-github-policy-service bot added the triage New issue. Needs to be looked at label Oct 8, 2024
@aminmashayekhi aminmashayekhi changed the title fix: OnClick event in FluentMenuItem does not work when it's an item of a FluentMenuButton fix: The OnClick event in FluentMenuItem does not function when it is an item within a FluentMenuButton. Oct 8, 2024
@dvoituron dvoituron self-assigned this Oct 9, 2024
@dvoituron dvoituron added status:in-progress Work is in progress and removed triage New issue. Needs to be looked at labels Oct 9, 2024
@dvoituron
Copy link
Collaborator

That will be fixed in the next Release: #2784

In the meantime, you can use the FluentMenuButton.OnMenuChanged event to detect when a menu item is clicked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:in-progress Work is in progress
Projects
None yet
Development

No branches or pull requests

2 participants