Skip to content

Commit 66a6d8e

Browse files
committed
5003 A11y labels on edit icons in Order Details
The two icon-only edit buttons (✎) for Shipping Address and Customer Note in the Order Details screen did not have accessibility labels, which meant that VoiceOver would read them as "Button" with no context or information about what the cell accessory button does. This adds an accessibility label to these two buttons, briefly describing their function.
1 parent 3490198 commit 66a6d8e

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

WooCommerce/Classes/ViewModels/Order Details/OrderDetailsDataSource.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ private extension OrderDetailsDataSource {
382382
cell.onEditTapped = { [weak self] in
383383
self?.onCellAction?(.editCustomerNote, nil)
384384
}
385+
386+
cell.editButtonAccessibilityLabel = NSLocalizedString(
387+
"Update Note",
388+
comment: "Accessibility Label for the edit button to change the Customer Provided Note in Order Details")
385389
}
386390

387391
private func configureBillingDetail(cell: WooBasicTableViewCell) {
@@ -788,6 +792,10 @@ private extension OrderDetailsDataSource {
788792
cell.onEditTapped = orderEditingEnabled ? { [weak self] in
789793
self?.onCellAction?(.editShippingAddress, nil)
790794
} : nil
795+
796+
cell.editButtonAccessibilityLabel = NSLocalizedString(
797+
"Update Address",
798+
comment: "Accessibility Label for the edit button to change the Customer Shipping Address in Order Details")
791799
}
792800

793801
private func configureShippingMethod(cell: CustomerNoteTableViewCell) {

WooCommerce/Classes/ViewRelated/Orders/Order Details/Customer Section/CustomerInfoTableViewCell.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ class CustomerInfoTableViewCell: UITableViewCell {
5656
}
5757
}
5858

59+
/// Accessibility label to be used on the edit button, when shown
60+
///
61+
var editButtonAccessibilityLabel: String? {
62+
get {
63+
editButton.accessibilityLabel
64+
}
65+
set {
66+
editButton.accessibilityLabel = newValue
67+
}
68+
}
69+
5970
override func awakeFromNib() {
6071
super.awakeFromNib()
6172

@@ -69,6 +80,7 @@ class CustomerInfoTableViewCell: UITableViewCell {
6980
nameLabel.text = nil
7081
addressLabel.text = nil
7182
onEditTapped = nil
83+
editButton.accessibilityLabel = nil
7284
}
7385
}
7486

WooCommerce/Classes/ViewRelated/Orders/Order Details/Customer Section/CustomerNoteTableViewCell.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ final class CustomerNoteTableViewCell: UITableViewCell {
4343
}
4444
}
4545

46+
/// Accessibility label to be used on the edit button, when shown
47+
///
48+
var editButtonAccessibilityLabel: String? {
49+
get {
50+
editButton.accessibilityLabel
51+
}
52+
set {
53+
editButton.accessibilityLabel = newValue
54+
}
55+
}
56+
4657
override func awakeFromNib() {
4758
super.awakeFromNib()
4859
configureBackground()
@@ -55,6 +66,7 @@ final class CustomerNoteTableViewCell: UITableViewCell {
5566
headlineLabel.text = nil
5667
bodyLabel.text = nil
5768
onEditTapped = nil
69+
editButton.accessibilityLabel = nil
5870
}
5971
}
6072

0 commit comments

Comments
 (0)