Skip to content

Setting KeyboardAccelerators on MenuBarItem in Loaded event of user control results in accelerator not working #10977

@marcelwgn

Description

@marcelwgn

Describe the bug

See attached repro project. Notice how Ctrl+Shift+D works while Ctrl+Shit+F does not.

App14.zip

Why is this important?

We ran into this after refactoring and suddenly no shortcuts working anymore.

Steps to reproduce the bug

  1. Create MenuBar inside a UserControl
  2. Add MenuBarItem in loaded event, add keyboard accelerators
  3. Hit keys of accelerator on keyboard, observe it not triggering.

In the case of the repro project, Ctrl+Shift+D works while Ctrl+Shift+F does not.

If the menubar is open, the shortcut Ctrl+Shift+F does work, if it is closed it does not.

Actual behavior

No response

Expected behavior

No response

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.8.3: 1.8.251106002

Windows version

Windows 11 (24H2): Build 26100

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageIssue needs to be triaged by the area owners

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions