Voiceover hint for macOS DetailedList items isn't helpful
freakboy3742 opened this issue · comments
Describe the bug
On macOS, the Voiceover assistant describes the content of DetailedList items as "<TogaData: 0xdeadbeef>", or similar. This isn't very helpful for navigation purposes.
Steps to reproduce
- Run the DetailedList example
- Turn on VoiceOver (Command-F5)
- Select an item
The text that is read won't be the title and subtitle, but "<Togadata...>"
Expected behavior
The VoiceOver description should accurately describe the content of the list item
Screenshots
Environment
- Operating System: macOS
- Python version: All
- Software versions:
- Toga: 0.4.2+
Logs
Additional context
The fix for this is to add an accessibilityValue()
objc_method to the implementation of TogaDetailedCell
. This is the macOS native implementation of an item in a detailedList; the default implementation is to read the description of the objectValue
instance associated with the cell, which is a TogaData object.
We can reliably know that the objectValue will be a TogaData object with title
and subtitle
keys; these can be used to construct a description that can be read.
See #2233 for a related accessibility feature.