dotnet / dotnet/maui

Unable to click a MenuItem programmatically through UI Automation

Open
#11,375 5 comments 0 reactions 0 assignees View on GitHub
area-controls-contextmenu platform/windows s/triaged s/verified t/a11y t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
296

Description

### Description

The MenuItem has a Clicked event handler which gets called when tapping on the item. However, the Clicked handler doesn't get called when double-tapping on the item when the Narrator screen reader's running. That action does result in the item becoming selected, (the item supports the UI Automation SelectionItem pattern). I've been unable to find a way to invoke the MenuItem's Clicked handler using Narrator with touch.

### Steps to Reproduce

Repro app at https://github.com/gbarkerz/MyVeryFirstMauiApp.

1. Run the app, run Narrator.
2. Tap on the Flyout button at the top left corner of the app, and double-tap to show the flyout.
3. Right-swipe to move Narrator down to the "Alpha" or "Beta" menu item.
4. Double-tap to click the menu item.

Expected: The menu item's Clicked handler gets called.
Actual: The menu item becomes selected.

Alternatively, keep this behavior, and have the menu item also support the UIA Invoke pattern, with the item being invokable through some other Narrator touch gesture, eg triple tap. (I don't the current thinking around design patterns for programmatic access to menu items.)

Note: As far as I know, I'm on the latest available .NET, but this is what I'm told...
runtimes-windows 7.0.0-rc.2.22472.3/7.0.100 VS 17.4.33027.239
maui-windows 7.0.0-rc.2.6866/7.0.100-rc.2 VS 17.4.33027.239

### Link to public reproduction project repository

https://github.com/gbarkerz/MyVeryFirstMauiApp

### Version with bug

Unknown/Other (please specify)

### Last version that worked well

Unknown/Other

### Affected platforms

Windows

### Affected platform versions

net7.0-windows10.0.19041.0

### Did you find any workaround?

No.

### Relevant log output

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked MyVeryFirstMauiApp reproduction and follow the Narrator touch steps for the Flyout's Alpha or Beta MenuItem. Investigate the MenuItem's Clicked event alongside its UI Automation SelectionItem behavior on Windows. Done means the documented interaction invokes Clicked, or the supported alternative UI Automation behavior is clearly established and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
accessibility, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.