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
Menu with duplicate accelerators always incorrectly selects the first one #13160
Comments
Hi! This also affects other controls which have a Label with a Target control set. If two labels share the same accelerator, only the first target control is focused instead of cycling through. Also note: there's no visual indicator on the target control that it received the focus. Probably also a bug. |
I don't know of any use case or situation were menu items will not have unique accelerators. In which case would one have duplicate accelerators? |
@emmauss then you probably haven't done more complex multi-lingual applications. It's not only affecting menus but also labels in forms. If you have multi-lingual apps where a dedicated team is translating the UI texts, you can't really guarantee that those letters you carefully picked in english are also available in the other language and, of course, you can't really guarantee if those letters are unique in all situations. besides that, it simply should work as mentioned, at least on windows/Win32/WinForms. it's is a valid scenario and it's also supported that way. |
@emmauss I submit as evidence Microsoft's Visual Studio, a reasonably popular application. It has a user interface whose menus have many menu items, and whose individual menu items can appear in multiple menus. This makes the likelihood of duplicate accelerators higher. In its Had Windows' menus worked the way Avalonia's menus work in v11.0.5, users who are restricted to using the keyboard to navigate menus for accessibility would be unable to use Visual Studio's menu system. This behavior in menus has been present in Windows since at least Windows 95, and is not restricted to menus. E.g. combo boxes, listboxes, and treeviews all support this type of keyboard navigation. If there are multiple visual items that match the letter the user entered, the user interface cycles around all the alternatives until the user confirms with |
Describe the bug
A menu with duplicate accelerators, when navigated with the keyboard, will incorrectly select the first one of the duplicates instead of leaving the menu open, to allow the user to type the accelerator again to select the next item,
Enter
orspace
to select the current menu item, orEsc
to cancel menu naviagation.To Reproduce
Alt+V
to bring up theView
menuD
orAlt+D
Result:
The menu is dismissed and the command bound to
Duplicate 1
is executed.Expected:
The menu to remain open, to allow a possible second
D
to selectDuplicate 2
Environment
Additional context
I've attached a zipped VS solution that exhibits the problem.
AvaloniaMenuBug.zip
The text was updated successfully, but these errors were encountered: