Skip to content

Commit 0345d96

Browse files
authored
Merge pull request #6635 from woocommerce/issue/6596-survey-close-button-label
Accessibility: Add accessibility label for the X close button
2 parents f7670c4 + a19b298 commit 0345d96

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

WooCommerce/Classes/Extensions/UIViewController+Helpers.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extension UIViewController {
3030
}
3131
else {
3232
navigationItem.leftBarButtonItem = UIBarButtonItem(image: .closeButton, style: .plain, target: target, action: action)
33+
navigationItem.leftBarButtonItem?.accessibilityLabel = Localization.close
3334
}
3435
}
3536

@@ -45,3 +46,10 @@ private extension UIViewController {
4546
dismiss(animated: true, completion: nil)
4647
}
4748
}
49+
50+
// MARK: Constants
51+
private extension UIViewController {
52+
enum Localization {
53+
static let close = NSLocalizedString("Close", comment: "Accessibility label for the close button")
54+
}
55+
}

0 commit comments

Comments
 (0)