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

Menu items do not have position information when created via ItemsSource #10100

Open
xj-ms opened this issue Nov 21, 2024 · 1 comment
Open
Labels
Accessibility An issue related to accessibility enhancements or blockers. Investigate Requires further investigation by the WPF team.

Comments

@xj-ms
Copy link

xj-ms commented Nov 21, 2024

Description

When a menu is populated with menu items in XAML, Windows Narrator can get the position info of each menu item and will announce them when focused.

However, when the menu items are generated from ItemsSource. The narrator won't be able to get position info and therefore won't announce it

<!-- This works -->
<Menu>
  <MenuItem Header="A" />
  <MenuItem Header="B" />
  <MenuItem Header="C" />
</Menu>

<!-- This doesn't. ItemHeaders can be a list of strings -->
<Menu ItemsSource={Binding ItemHeaders} />

More specifically, MenuItemAutomationPeer throws exceptions in GetPositionInSet and GetSizeOfSet if ItemsSource is used.

Reproduction Steps

  1. Create a menu with ItemsSource bound to a collection of string
  2. Run the application.
  3. Run Windows Narrator
  4. Tab over the menu items

Expected behavior

The narrator should announce the header of a menu item as well as its position, e.g. 3 of 5

Actual behavior

Only the header is announced by the narrator

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

No response

Other information

No response

@lindexi lindexi added the Investigate Requires further investigation by the WPF team. label Nov 21, 2024
@miloush miloush added the Accessibility An issue related to accessibility enhancements or blockers. label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility An issue related to accessibility enhancements or blockers. Investigate Requires further investigation by the WPF team.
Projects
None yet
Development

No branches or pull requests

3 participants