make explicit accessibility label for modals and error messages of text input

pull/1033/head
Ryan ZHAO 6 months ago
parent b2ce98ea83
commit 57ca0dad8e

@ -275,9 +275,11 @@ public class ConfirmationModal: Modal, UITextFieldDelegate {
titleLabel.isAccessibilityElement = true
titleLabel.accessibilityIdentifier = "Modal heading" // stringlint:disable
titleLabel.accessibilityLabel = titleLabel.text
explanationLabel.isAccessibilityElement = true
explanationLabel.accessibilityIdentifier = "Modal description" // stringlint:disable
explanationLabel.accessibilityLabel = explanationLabel.text
}
// MARK: - UITextFieldDelegate

@ -122,7 +122,8 @@ public struct SessionTextField<ExplanationView>: View where ExplanationView: Vie
.multilineTextAlignment(.center)
.accessibility(
Accessibility(
identifier: "Error message"
identifier: "Error message",
label: error ?? previousError
)
)
} else {

Loading…
Cancel
Save