-
-
Notifications
You must be signed in to change notification settings - Fork 639
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
WPF combobox with datatemplate - class name read instead of value #3574
Comments
Attachment TestComboBox.exe added by manish on 2013-10-11 06:41 |
Attachment TestComboBox-source.zip added by manish on 2013-10-11 06:41 |
Comment 1 by jteh on 2013-10-11 07:30 |
Comment 2 by manish on 2013-10-31 06:01 If I implement the ToString() method in the Fruit class in this example, then we'll get a valid name read out. In the .Net world, however, we hardly ever implement the ToString() method on a class unless if we explicitly need it for some reason. There is almost never a reason to do this. A potential huristic way of getting around this problem is for NVDA to check if the ListItem has any children (which will mean that a dataTemplate has been used) and then to check if the first "n" elements in the list all return the same "name" (which will mean that "ToString()" has not been implemented on the underlying object. This has obvious flaws in the sense that all first "n" may actually be the same (e.g. the first 10 mails in the mailbox may all be from the same sender and subject etc.) However, in either case, we aren't really any worse off that the current situation and the upside is much better usability of WPF combo boxes and list boxes. |
Comment 3 by jteh on 2013-10-31 08:15 That aside, my main concern is speed, which is why I'd prefer to restrict this to only certain combo boxes. Fetching/iterating over children is not cheap as far as performance is concerned. Maybe we can just do it for all WPF combo boxes based either on the window class name or UIA provider description/class name. |
Sounds a bit like a needs an external fix. Note that wpf has more brokenness in it, for example regarding data grids. |
@manish, @LeonarddeR, @jcsteh if this is still an issue, are there any improvements made by UIA in this regard? |
I have tested with NVDA 2019.1.1, this is still an issue. |
Hello, |
This is still an issue in NVDA 2023.3. |
It's kind of hidden in the post from Oct 31, 2023, so I think some people are missing it. But the workaround is to just implement ToString in the model class. That worked for me. |
cc: @siagupta0202, @anjali-wpf, @arpitmathur, @dipeshmsft, @himgoyalmicro, @harshit7962 could someone please look into this? It seems this needs a fix from WPF side, so combo boxes are handled properly. NVDA users need to use a quite uncomfortalbe workaround with object navigation in order to work with such combo boxes, and this type of navigation is not really intuitive especially for new screen reader users. |
@michaelweghorn you implemented #17443. Would it help in this particular case? Does the labelled by property support make data items to be announced instead of the class name on the parent object level? |
I haven't tried to run the attached example, but this sounds unrelated to me at first. |
Reported by manish on 2013-10-11 06:37
in WPF, if I use a combo box in an application, NVDA assigns the UIA class ComboBoxWithoutValuePattern to this control.
If the control contains list items directly, then this works correctly and the list item name is spoken.
However, if I use a data template to display a value in the combo box, then instead of the text displayed in the list item, the name of the class of the list item is spoken. I have to use object navigation to go to the child of each list item to read the actual text displayed.
The attached application has an example of a working and a non working combo box. Also attached is a zip of the source of this app.
In this app, the second combo box shows values like "apple", "orange", "cherry" while NVDA reads "TestComboBox.Fruit" for all the items , which is actually the name of the underlying class bound to the combo box.
This problem occurs in many applications built using WPF, including VS 2012, ms office 2013 etc.
The text was updated successfully, but these errors were encountered: