Merge branch 'bugfix/PRODDEF-19592' into 'develop'
Updated textView to have label text for accessibility behavior ### Summary Updated textView to have label text for accessibility behavior ### JIRA Ticket https://onejira.verizon.com/browse/PRODDEF-19592 Co-authored-by: Keerthy <keerthy.marakanti@verizon.com> See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1029
This commit is contained in:
commit
2a847602a2
@ -161,7 +161,7 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
|
|||||||
bottomConstraint?.isActive = true
|
bottomConstraint?.isActive = true
|
||||||
|
|
||||||
heightConstraint = textView.heightAnchor.constraint(equalToConstant: 0)
|
heightConstraint = textView.heightAnchor.constraint(equalToConstant: 0)
|
||||||
accessibilityElements = [titleLabel, textView, feedbackLabel]
|
accessibilityElements = [textView]
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func updateView(_ size: CGFloat) {
|
open override func updateView(_ size: CGFloat) {
|
||||||
@ -281,6 +281,25 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
|
|||||||
if model.hideBorders {
|
if model.hideBorders {
|
||||||
adjustMarginConstraints(constant: 0)
|
adjustMarginConstraints(constant: 0)
|
||||||
}
|
}
|
||||||
|
updateAccessibility(model: model)
|
||||||
|
}
|
||||||
|
|
||||||
|
func updateAccessibility(model: TextViewEntryFieldModel) {
|
||||||
|
|
||||||
|
var message = ""
|
||||||
|
|
||||||
|
if let titleText = model.accessibilityText ?? model.title {
|
||||||
|
message += "\(titleText) \( model.enabled ? String(format: (MVMCoreUIUtility.hardcodedString(withKey: "textfield_optional")) ?? "") : "" ) \(self.textView.isEnabled ? "" : MVMCoreUIUtility.hardcodedString(withKey: "textfield_disabled_state") ?? "")"
|
||||||
|
}
|
||||||
|
|
||||||
|
if let feedback = model.feedback {
|
||||||
|
message += ", " + feedback
|
||||||
|
}
|
||||||
|
|
||||||
|
if let errorMessage = errorLabel.text {
|
||||||
|
message += ", " + errorMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
textView.accessibilityLabel = message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,7 +98,6 @@ import UIKit
|
|||||||
smartInsertDeleteType = .no
|
smartInsertDeleteType = .no
|
||||||
inputAccessoryView = nil
|
inputAccessoryView = nil
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityTraits = .staticText
|
|
||||||
font = fontStyle.getFont()
|
font = fontStyle.getFont()
|
||||||
keyboardType = .default
|
keyboardType = .default
|
||||||
isEditable = true
|
isEditable = true
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
// MARK: Textfield
|
// MARK: Textfield
|
||||||
"textfield_today_string" = "Today";
|
"textfield_today_string" = "Today";
|
||||||
"textfield_error_message" = "%@.\n The error message.\n %@";
|
"textfield_error_message" = "%@.\n The error message.\n %@";
|
||||||
|
"textView_error_message" = "%@.\n The error message.\n %@";
|
||||||
"textfield_picker_item" = " picker item";
|
"textfield_picker_item" = " picker item";
|
||||||
"textfield_regular" = " regular";
|
"textfield_regular" = " regular";
|
||||||
"textfield_disabled_state" = "disabled";
|
"textfield_disabled_state" = "disabled";
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
// Textfield
|
// Textfield
|
||||||
"textfield_today_string" = "Hoy";
|
"textfield_today_string" = "Hoy";
|
||||||
"textfield_error_message" = "%@.\n El mensaje de error.\n %@";
|
"textfield_error_message" = "%@.\n El mensaje de error.\n %@";
|
||||||
|
"textView_error_message" = "%@.\n El mensaje de error.\n %@";
|
||||||
"textfield_picker_item" = " artículo de selector";
|
"textfield_picker_item" = " artículo de selector";
|
||||||
"textfield_regular" = " regular";
|
"textfield_regular" = " regular";
|
||||||
"textfield_disabled_state" = "inactivo";
|
"textfield_disabled_state" = "inactivo";
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
// Textfield
|
// Textfield
|
||||||
"textfield_today_string" = "Hoy";
|
"textfield_today_string" = "Hoy";
|
||||||
"textfield_error_message" = "%@.\n El mensaje de error.\n %@";
|
"textfield_error_message" = "%@.\n El mensaje de error.\n %@";
|
||||||
|
"textView_error_message" = "%@.\n El mensaje de error.\n %@";
|
||||||
"textfield_picker_item" = " artículo de selector";
|
"textfield_picker_item" = " artículo de selector";
|
||||||
"textfield_regular" = " regular";
|
"textfield_regular" = " regular";
|
||||||
"textfield_disabled_state" = "inactivo";
|
"textfield_disabled_state" = "inactivo";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user