CommunityToolkit / WindowsCommunityToolkit

The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building .NET apps with UWP and the Windows App SDK / WinUI 3 for Windows 10 and Windows 11. The toolkit is part of the .NET Foundation.
https://docs.microsoft.com/windows/communitytoolkit/
Other
5.9k stars 1.37k forks source link

Unable to set AutomationProperties on DataGridCell #3400

Open mrlacey opened 4 years ago

mrlacey commented 4 years ago

Describe the bug

If using a DataGridTemplateColumn inside a DataGrid, it is not possible to set the appropriate automation properties on the DataCellTemplate. This leads to a UI Automation Tree that fails basic accessibility testing with Accessibility Insights for Windows. Specifically, it fails due to issues related to Section 508 502.3.1.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a UWP app with Windows Template Studio
  2. Include a "DataGrid" page
  3. Test the app with 'Accessibility Insights for Windows'
  4. See failing tests

Expected behavior

It should be possible to set automation properties of all controls and controls provided by the toolkit should not prevent a developer from creating a fully accessible application.

Specifically, it should be possible to change the default automation properties provided by the DataGridCell. Preferably by exposed propertied, or by subclassing.

Screenshots

If applicable, add screenshots to help explain your problem.

This XAML:

image

Produces a UI Automation Tree like this:

image

Note the custom element with no name. This is what can't be changed.

Environment

NuGet Package(s): Microsoft.Toolkit.Uwp.UI.Controls.DataGrid

Package Version(s): 6.1.0

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] May 2020 Update (19041)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [x] May 2019 Update (18362)
- [x] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x] 2019 (version: 16.6.4) 
- [ ] 2019 Preview (version: )

Additional context

This was discovered while investigating the accessibility of apps generated by Windows Template Studio https://github.com/microsoft/WindowsTemplateStudio/issues/3723

Originally raised as a question at https://stackoverflow.com/questions/63106165/how-to-set-the-automation-properties-of-a-datagridtemplatecolumn but now raising as an issue because it appears to be a limitation of the current implementation.

I recognize this is a potentially non-trivial fix and may not be addressed in the Toolkit but will have to wait until moved to be part of WinUI before it's addressed. If that's the case, it would be good to have this confirmed so expectations can be managed appropriately.

Also, connected with #3079 as this must be addressed to fully make an accessible content row.

ghost commented 4 years ago

Hello mrlacey, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

Kyaa-dost commented 4 years ago

@anawishnoff ⬆️

michael-hawker commented 4 years ago

Thanks @mrlacey for reporting and raising this issue. You're right that most focus in on WinUI 3 at the moment. We have been communicating with @anawishnoff and @RBrid about trying to fix some DataGrid issues for the 7.0 Toolkit release as a stop-gap still. I've added this one into the milestone for tracking and hopefully we can find out the scope of these tasks.

Please continue to file any accessibility issues you find in the Toolkit, it's been a little while since our last audit in this space. I'll add it to our technical debt backlog for 7.0 for tracking to figure out a plan. Let me know if you'd want to champion this space for the Toolkit.

ghost commented 3 years ago

Thanks mrlacey for patiently waiting while the team is still investigating the issue.

@anawishnoff @RBrid can we please have an update on this issue? Thanks

ghost commented 3 years ago

Thanks mrlacey for patiently waiting while the team is still investigating the issue.

@anawishnoff @RBrid can we please have an update on this issue? Thanks

ghost commented 3 years ago

Thanks mrlacey for patiently waiting while the team is still investigating the issue.

@anawishnoff @RBrid can we please have an update on this issue? Thanks

ghost commented 3 years ago

Thanks mrlacey for patiently waiting while the team is still investigating the issue.

@anawishnoff @RBrid can we please have an update on this issue? Thanks