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 or space to select the current menu item, or Esc to cancel menu naviagation.
To Reproduce
- Create a window with the following menu:
<Menu>
<MenuItem Header="_File">
<MenuItem Header="E_xit" Command="{Binding FileExit}" />
</MenuItem>
<MenuItem Header="_View">
<MenuItem Header="_Duplicate 1" Command="{Binding ViewDuplicate1}"/>
<MenuItem Header="_Duplicate 2" Command="{Binding ViewDuplicate2}"/>
</MenuItem>
</Menu>
- Type
Alt+V to bring up the View menu
- Type
D or Alt+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 select Duplicate 2
Environment
- OS: reproduced on Windows.
- Avalonia-Version: reproduced on 11.0.4
Additional context
I've attached a zipped VS solution that exhibits the problem.
AvaloniaMenuBug.zip
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,
Enterorspaceto select the current menu item, orEscto cancel menu naviagation.To Reproduce
Alt+Vto bring up theViewmenuDorAlt+DResult:
The menu is dismissed and the command bound to
Duplicate 1is executed.Expected:
The menu to remain open, to allow a possible second
Dto selectDuplicate 2Environment
Additional context
I've attached a zipped VS solution that exhibits the problem.
AvaloniaMenuBug.zip