dotnet / dotnet/maui

Unable to customize the UI Automation Name property of CollectionView items

Open
#6,803 1 comment 1 reaction 0 assignees View on GitHub
area-controls-collectionview legacy-area-a11y platform/windows s/triaged t/a11y t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

I created a new MAUI app in Visual Studio Community 2022 V 17.2.0 Preview 6.0, and Microsoft.Maui.Dependencies/Extensions 6.0.300-rc.2.5513. I then added a CollectionView based on demo code at https://docs.microsoft.com/en-us/dotnet/maui/user-interface/controls/collectionview/layout. The app code is public at https://github.com/gbarkerz/DemoList.

When I run the app, Accessibility Insights for Windows reports that the UI Automation Name property for all items in the CollectionView is "Microsoft.Maui.Controls.Platform.ItemTemplateContext". I've not been able to find a way of customizing the UI Automation Name property of the items, which means the Narrator screen reader announces that namespace/class name as it moves between the items.

The image below shows Accessibility Insights for Windows reporting the UI Automation Names of the items.

I've not been able to find any official documentation showing best practices relating to setting the custom item accessible names. (The traditional steps used for desktop UWP XAML haven't been successful for me.)

![MauiListUIA](https://user-images.githubusercontent.com/77085891/166658905-c3d3772d-9984-427f-ab5c-ba222907f7d2.jpg)

### Steps to Reproduce

1. Create a new MAUI app in Visual Studio Community 2022 V 17.2.0 Preview 6.0, and Microsoft.Maui.Dependencies/Extensions 6.0.300-rc.2.5513.
2. Add a CollectionView based on demo code at https://docs.microsoft.com/en-us/dotnet/maui/user-interface/controls/collectionview/layout.
3. Point Accessibility Insights for Windows at the app and observe the UI Automation Name property for all items.
4. Try to find a way to customize that Name of the items to be other than "Microsoft.Maui.Controls.Platform.ItemTemplateContext".

### Version with bug

Release Candidate 2 (current)

### Last version that worked well

Unknown/Other

### Affected platforms

Windows

### Affected platform versions

net6.0-windows10.0.19041.0

### Did you find any workaround?

No workaround found.

### Relevant log output

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the public DemoList reproduction and the CollectionView layout sample, then compare the item UI Automation Name values in Accessibility Insights for Windows. Trace how CollectionView items are exposed to Windows accessibility and verify that Narrator announces meaningful item names instead of Microsoft.Maui.Controls.Platform.ItemTemplateContext.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.