refactored textarea

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-06-14 11:33:59 -05:00
parent 9538912a72
commit c1f2aa6591

View File

@ -137,7 +137,8 @@ open class TextArea: EntryFieldBase {
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
open override func setup() { open override func setup() {
super.setup() super.setup()
containerView.isAccessibilityElement = true
textView.isAccessibilityElement = false
textView.isScrollEnabled = true textView.isScrollEnabled = true
textView.autocorrectionType = .no textView.autocorrectionType = .no
@ -194,8 +195,9 @@ open class TextArea: EntryFieldBase {
open override func updateAccessibility() { open override func updateAccessibility() {
super.updateAccessibility() super.updateAccessibility()
textView.accessibilityLabel = accessibilityLabelText containerView.accessibilityLabel = "\(Self.self), \(accessibilityLabelText)"
textView.accessibilityHint = isReadOnly || !isEnabled ? "" : "Double tap to open." containerView.accessibilityHint = isReadOnly || !isEnabled ? "" : "Double tap to open."
containerView.accessibilityValue = value
} }
override func updateRules() { override func updateRules() {
@ -225,7 +227,7 @@ open class TextArea: EntryFieldBase {
open override var accessibilityElements: [Any]? { open override var accessibilityElements: [Any]? {
get { get {
var elements = [Any]() var elements = [Any]()
elements.append(contentsOf: [titleLabel, textView]) elements.append(contentsOf: [titleLabel, containerView])
if showError { if showError {
elements.append(statusIcon) elements.append(statusIcon)