implemented new internal error handling
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
4df689b275
commit
b907e0e001
@ -112,6 +112,7 @@ open class TextArea: EntryFieldBase {
|
||||
get { textView.text }
|
||||
set {
|
||||
textView.text = newValue
|
||||
value = newValue
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,7 +228,7 @@ open class TextArea: EntryFieldBase {
|
||||
bottomStackView.addArrangedSubview(characterCounterLabel)
|
||||
return bottomView
|
||||
}
|
||||
|
||||
|
||||
/// Used to update any Accessibility properties.
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
@ -246,12 +247,13 @@ open class TextArea: EntryFieldBase {
|
||||
let countStr = (count > maxLength ?? 0) ? ("-" + "\(count-(maxLength ?? 0))") : "\(count)"
|
||||
if ((maxLength ?? 0) > 0) {
|
||||
if (count > (maxLength ?? 0)) {
|
||||
showError = true
|
||||
errorText = "You have exceeded the character limit."
|
||||
showInternalError = true
|
||||
internalErrorText = "You have exceeded the character limit."
|
||||
return countStr
|
||||
} else {
|
||||
showError = false
|
||||
errorText = nil
|
||||
|
||||
showInternalError = false
|
||||
internalErrorText = nil
|
||||
return ("\(countStr)" + "/" + "\(maxLength ?? 0)")
|
||||
}
|
||||
} else {
|
||||
@ -303,7 +305,7 @@ extension TextArea: UITextViewDelegate {
|
||||
highlightCharacterOverflow()
|
||||
|
||||
//setting the value and firing control event
|
||||
value = textView.text
|
||||
text = textView.text
|
||||
sendActions(for: .valueChanged)
|
||||
} else {
|
||||
textView.text.removeLast()
|
||||
@ -311,7 +313,7 @@ extension TextArea: UITextViewDelegate {
|
||||
}
|
||||
} else {
|
||||
//setting the value and firing control event
|
||||
value = textView.text
|
||||
text = textView.text
|
||||
sendActions(for: .valueChanged)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user