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

Context menu keyboard shortcut ignored until menu is visible at least once (Windows) #16314

Closed
TangDave opened this issue Jul 15, 2024 · 2 comments

Comments

@TangDave
Copy link

Describe the bug

Context menu keyboard shortcuts do not work until the menu has been visible once.

To Reproduce

Create a TextBox with a ContextMenu with just one item - give that item a shortcut 'Ctrl-M'. Add a handler to do something like show a message (I know that Avalonia doesn't have this simplest of features, but you get the idea - create your own messagebox like the rest of us).
At runtime:

  1. Press 'Ctrl-M' - nothing happens
  2. Bring up the context menu via right-click and then close the context menu
  3. Press 'Ctrl-M' - the message appears

Obviously, you shouldn't have to show a context menu once to activate a keyboard shortcut - otherwise what's the point of a keyboard shortcut?

Expected behavior

No response

Avalonia version

11.0.11

OS

Windows

Additional context

No response

@TangDave TangDave added the bug label Jul 15, 2024
@timunie
Copy link
Contributor

timunie commented Jul 15, 2024

That's a known current limitation. Use KeyBindings instead.

@timunie
Copy link
Contributor

timunie commented Jul 15, 2024

#2441

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

No branches or pull requests

2 participants