microsoft / microsoft/fluentui-blazor

FluentMenuItem Enter key does not invoke OnClick in standalone FluentMenu

Open
#5,000 2 comments 0 reactions 1 assignee View on GitHub

@adamint is already working on this.

Since Jul 9, 2026.

a11y community:contribution v4
Dominant language
C#
Stars
4.8k
Forks
483
Avg merge
14h 41m
Merged PRs (30d)
68

Description

Describe the bug

When a FluentMenuItem inside a standalone FluentMenu is focused, pressing Enter does not invoke the Blazor OnClick callback. Pointer click on the same item does invoke OnClick.

Expected behavior

Keyboard activation with Enter should behave like pointer activation and invoke the menu item's OnClick callback.

Actual behavior

The focused fluent-menu-item receives browser keydown and keyup events for Enter, but the configured Blazor OnClick callback is not invoked.

Notes from investigation

This was observed while fixing keyboard accessibility in the Aspire Dashboard Resources page.

Diagnostics against Microsoft.FluentUI.AspNetCore.Components 4.14.1:

  • The browser event target and active element were both fluent-menu-item.
  • Document capture and bubble listeners both observed keydown for Enter|Enter.
  • Document capture observed keyup for Enter|Enter.
  • No synthetic click was emitted by the browser.
  • Pointer click on the same FluentMenuItem invoked the configured Blazor OnClick callback.
  • Decompiling FluentMenuItem showed an internal OnKeyDownHandlerAsync path that appears intended to call OnClickHandlerAsync(new MouseEventArgs()) when KeyboardEventArgs.Code == "Enter", but that path did not result in the public OnClick callback being invoked in this rendered standalone-menu shape.
  • Passing onkeyup through AdditionalAttributes or Razor unmatched attributes on FluentMenuItem also did not reach the app callback in this shape.
Related downstream context

Downstream PR: https://github.com/microsoft/aspire/pull/17926

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.