diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index ce6c64879123..7f2a9d817a3e 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -3,6 +3,7 @@ * [*] Custom Post Types: Make custom post types with REST API and editor support available in My Site [#25849] * [*] Stop the media picker from removing gallery images when you cancel it in the experimental editor [#25866] * [*] Stats: Fix the screen getting stuck on a loading indicator for self-hosted sites that are not connected to Jetpack [#25858] +* [*] Accessibility: VoiceOver now announces which post categories are selected [#25737] 27.1 ----- diff --git a/WordPress/Classes/ViewRelated/Post/Categories/PostCategoriesViewController.swift b/WordPress/Classes/ViewRelated/Post/Categories/PostCategoriesViewController.swift index c05ff1ed6544..305d1ae99452 100644 --- a/WordPress/Classes/ViewRelated/Post/Categories/PostCategoriesViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Categories/PostCategoriesViewController.swift @@ -178,9 +178,20 @@ import WordPressUI let indentationLevel = categoryIndentationDict[category.categoryID.intValue] cell.indentationLevel = indentationLevel ?? 0 cell.indentationWidth = Constants.categoryCellIndentation - cell.textLabel?.text = category.categoryName.stringByDecodingXMLCharacters() + let title = category.categoryName.stringByDecodingXMLCharacters() + cell.textLabel?.text = title WPStyleGuide.configureTableViewCell(cell) - cell.accessoryView = makeAccessoryView(isSelected: selectedCategories.contains(category)) + + let isSelected = selectedCategories.contains(category) + cell.accessoryView = makeAccessoryView(isSelected: isSelected) + + // The checkmark is drawn in an image view, which carries no accessibility + // information, so selected and unselected rows were indistinguishable. + // Make the cell a single element and let the trait carry the state, rather + // than appending "selected" to the label. + cell.isAccessibilityElement = true + cell.accessibilityLabel = title + cell.accessibilityTraits = isSelected ? [.selected] : [] } private func makeAccessoryView(isSelected: Bool) -> UIView {