Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm

Issue 2856113002: CollectionViewTextItem should copy accessibilityLabel to the cell (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ios/chrome/browser/ui/collection_view/cells/collection_view_text_item_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm
diff --git a/ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm b/ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm
index a01c7aef5f5201a5ca31f53d2c9140acf8bddc0c..f6d4a0057b1cf8e52583e164cfc14aa7e608dabc 100644
--- a/ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm
+++ b/ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.mm
@@ -71,11 +71,15 @@
cell.textLabel.text = self.text;
cell.detailTextLabel.text = self.detailText;
cell.isAccessibilityElement = YES;
- if (self.detailText.length == 0) {
- cell.accessibilityLabel = self.text;
+ if ([self.accessibilityLabel length] != 0) {
+ cell.accessibilityLabel = self.accessibilityLabel;
} else {
- cell.accessibilityLabel =
- [NSString stringWithFormat:@"%@, %@", self.text, self.detailText];
+ if (self.detailText.length == 0) {
+ cell.accessibilityLabel = self.text;
+ } else {
+ cell.accessibilityLabel =
+ [NSString stringWithFormat:@"%@, %@", self.text, self.detailText];
+ }
}
// Styling.
« no previous file with comments | « no previous file | ios/chrome/browser/ui/collection_view/cells/collection_view_text_item_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698