-
Notifications
You must be signed in to change notification settings - Fork 25
fix(ui): label the shared controls VoiceOver could not announce #1096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,6 +120,9 @@ class NumberKeyboardButton: UIView { | |
| private func reloadTitle() { | ||
| #if SNAPSHOT | ||
| if value == .separator { | ||
| // The button view is the exposed accessibility element, so the XCUITest | ||
| // id lives on it as well as on the label | ||
| accessibilityIdentifier = "amount_button_separator" | ||
| titleLabel.accessibilityIdentifier = "amount_button_separator" | ||
| } | ||
| #endif // SNAPSHOT | ||
|
|
@@ -153,6 +156,37 @@ class NumberKeyboardButton: UIView { | |
|
|
||
| titleLabel.attributedText = attributedText | ||
| } | ||
|
|
||
| updateAccessibility() | ||
| } | ||
|
|
||
| private func updateAccessibility() { | ||
| switch value { | ||
| case .empty: | ||
| // A spacer key: hidden from VoiceOver entirely | ||
| isAccessibilityElement = false | ||
| accessibilityElementsHidden = true | ||
| accessibilityLabel = nil | ||
| accessibilityTraits = [] | ||
| case .digit, .custom: | ||
| isAccessibilityElement = true | ||
| accessibilityElementsHidden = false | ||
| accessibilityLabel = value.stringValue | ||
| accessibilityTraits = .button | ||
|
Comment on lines
+172
to
+175
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: Update the screenshot test to query keypad digits as buttons Making the key itself an accessibility element with the button trait replaces its child label's static-text representation. However, DashWalletScreenshotsUITests/DashWalletScreenshotsUITests.swift:63 still uses source: ['claude'] |
||
| case .separator: | ||
| isAccessibilityElement = true | ||
| accessibilityElementsHidden = false | ||
| accessibilityLabel = NSLocalizedString("Decimal separator", | ||
| comment: "VoiceOver label for the decimal separator key on the number keyboard") | ||
| accessibilityTraits = .button | ||
| case .delete: | ||
| // The visible title is an SF Symbol attachment, so the spoken label is set explicitly | ||
| isAccessibilityElement = true | ||
| accessibilityElementsHidden = false | ||
| accessibilityLabel = NSLocalizedString("Delete", | ||
| comment: "VoiceOver label for the delete key on the number keyboard") | ||
| accessibilityTraits = .button | ||
| } | ||
| } | ||
|
|
||
| private func updateBackgroundView() { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.