CXTDT-560823 – TextArea – Accessibility Labels/Error/ReadyOnly/Disabled.
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
a7524e6318
commit
40a31dfe25
@ -147,12 +147,7 @@ open class DatePicker: EntryFieldBase, DatePickerViewControllerDelegate, UIPopov
|
||||
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
let label = "Date Picker, \(isReadOnly ? ", read only" : "")"
|
||||
if let errorText, showError {
|
||||
fieldStackView.accessibilityLabel = "\(label) ,error, \(errorText)"
|
||||
} else {
|
||||
fieldStackView.accessibilityLabel = label
|
||||
}
|
||||
fieldStackView.accessibilityLabel = "Date Picker, \(accessibilityLabelText)"
|
||||
fieldStackView.accessibilityHint = isReadOnly || !isEnabled ? "" : "Double tap to open."
|
||||
fieldStackView.accessibilityValue = value
|
||||
}
|
||||
|
||||
@ -278,12 +278,7 @@ open class DropdownSelect: EntryFieldBase {
|
||||
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
let label = "Dropdown Select, \(isReadOnly ? ", read only" : "")"
|
||||
if let errorText, showError {
|
||||
fieldStackView.accessibilityLabel = "\(label) ,error, \(errorText)"
|
||||
} else {
|
||||
fieldStackView.accessibilityLabel = label
|
||||
}
|
||||
fieldStackView.accessibilityLabel = "Dropdown Select, \(accessibilityLabelText)"
|
||||
fieldStackView.accessibilityHint = isReadOnly || !isEnabled ? "" : "Double tap to open."
|
||||
fieldStackView.accessibilityValue = value
|
||||
}
|
||||
|
||||
@ -241,6 +241,23 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
||||
|
||||
open var rules = [AnyRule<String>]()
|
||||
|
||||
open var accessibilityLabelText: String {
|
||||
var accessibilityLabels = [String]()
|
||||
if let text = titleLabel.text {
|
||||
accessibilityLabels.append(text)
|
||||
}
|
||||
if isReadOnly {
|
||||
accessibilityLabels.append("read only")
|
||||
}
|
||||
if !isEnabled {
|
||||
accessibilityLabels.append("dimmed")
|
||||
}
|
||||
if let errorText, showError {
|
||||
accessibilityLabels.append("error, \(errorText)")
|
||||
}
|
||||
return accessibilityLabels.joined(separator: ", ")
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Overrides
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -225,15 +225,10 @@ open class InputField: EntryFieldBase {
|
||||
textField.isUserInteractionEnabled = isEnabled && !isReadOnly
|
||||
textField.textColor = textFieldTextColorConfiguration.getColor(self)
|
||||
}
|
||||
|
||||
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
let label = "\(isReadOnly ? "read only" : "")"
|
||||
if let errorText, showError {
|
||||
textField.accessibilityLabel = "\(label) ,error, \(errorText)"
|
||||
} else {
|
||||
textField.accessibilityLabel = label
|
||||
}
|
||||
textField.accessibilityLabel = accessibilityLabelText
|
||||
textField.accessibilityHint = isReadOnly || !isEnabled ? "" : "Double tap to open."
|
||||
}
|
||||
|
||||
|
||||
@ -195,12 +195,7 @@ open class TextArea: EntryFieldBase {
|
||||
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
let label = "\(isReadOnly ? "read only" : "")"
|
||||
if let errorText, showError {
|
||||
textView.accessibilityLabel = "\(label) ,error, \(errorText)"
|
||||
} else {
|
||||
textView.accessibilityLabel = label
|
||||
}
|
||||
textView.accessibilityLabel = accessibilityLabelText
|
||||
textView.accessibilityHint = isReadOnly || !isEnabled ? "" : "Double tap to open."
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
- CXTDT-565087 - Input Field - Text - OnDark colors
|
||||
- CXTDT-565112 - Input Field - Credit Card icons
|
||||
- CXTDT-565117 - Input Field - Overflow not clipped
|
||||
- CXTDT-560823 – TextArea – Accessibility Labels/Error/ReadyOnly/Disabled
|
||||
|
||||
1.0.65
|
||||
----------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user