Accessibility Insights for Windows tool reports that "Name" attribute is missing for some elements e.g TreeView, this basically forces me to provide this attribute but in some cases it's not actually necessary for narrator to read this. So I am wondering if there is a way to make my application pass the tests in this tool but also skip narrator reading an AutomatinProperty.Name ?
1 Answers
I'm an engineer on the Accessibility Insights team. No, Accessibility Insights for Windows does not provide a way to turn off certain requirements.
Could you explain why you believe the TreeView does not require an accessible name, or give an example of a case where a name is not required? Screen readers typically do announce the name of a TreeView, which gives the user additional context about the tree (more information about TreeView and accessible names here).
Edit: It seems you were actually asking whether an element can be hidden from a screen reader without hiding all its children. While I'm not aware of a way to do that, it sounds like in the case you describe the text box is a label for the element that you want narrator to skip over. In this case, you can associate the label with the element by setting AutomationProperties.LabeledBy, which will serve the same purpose as the Name property (the first code example here shows how to do this). Does that help in your scenario?

- 46
- 2
-
Hi, I didn't mean to turn off anything in the tool but was wondering if it's possible in xaml. Perhaps TreeView is not the best example but I think any control that is a list with elements is required to have the "Name" but is some cases this might not be necessary e.g I have a list view and user is already aware what this list view represents because this is described in text box above the list view so I don't want the list view it self to describe the same thing again and for the reader to announce twice same information. – IronHide Aug 25 '20 at 07:48
-
Sorry, I misinterpreted the question. I'll update my answer. – Kelsey Pownell Aug 25 '20 at 23:59
-
Thank you for the suggestion it was helpful. I have another question though, why when i set Focusable=false on TextBlock, the Accessibility tool still complain about not having a name attribute ? – IronHide Aug 28 '20 at 05:54
-
Hm, I don't get that behavior when I try to repro. Can you use the inspect tab in Accessibility Insights to make sure the element's name was properly set? You can also find more code samples in the fastpass view that might help you fix it (click "View results in the UI Automation tree"). If the name is getting set properly in the automation tree and you believe this is a bug in the Accessibility Insights tool, you can file a bug in our github repo (https://github.com/microsoft/accessibility-insights-windows) and we will triage the issue. – Kelsey Pownell Aug 28 '20 at 18:26
-
This is the example of xaml that does not pass in .net 4.6.1 but it passes in 4.8 also if i change the visibility to hidden it works but it's not feasible for me. `
: