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 }
|
get { textView.text }
|
||||||
set {
|
set {
|
||||||
textView.text = newValue
|
textView.text = newValue
|
||||||
|
value = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,12 +247,13 @@ open class TextArea: EntryFieldBase {
|
|||||||
let countStr = (count > maxLength ?? 0) ? ("-" + "\(count-(maxLength ?? 0))") : "\(count)"
|
let countStr = (count > maxLength ?? 0) ? ("-" + "\(count-(maxLength ?? 0))") : "\(count)"
|
||||||
if ((maxLength ?? 0) > 0) {
|
if ((maxLength ?? 0) > 0) {
|
||||||
if (count > (maxLength ?? 0)) {
|
if (count > (maxLength ?? 0)) {
|
||||||
showError = true
|
showInternalError = true
|
||||||
errorText = "You have exceeded the character limit."
|
internalErrorText = "You have exceeded the character limit."
|
||||||
return countStr
|
return countStr
|
||||||
} else {
|
} else {
|
||||||
showError = false
|
|
||||||
errorText = nil
|
showInternalError = false
|
||||||
|
internalErrorText = nil
|
||||||
return ("\(countStr)" + "/" + "\(maxLength ?? 0)")
|
return ("\(countStr)" + "/" + "\(maxLength ?? 0)")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -303,7 +305,7 @@ extension TextArea: UITextViewDelegate {
|
|||||||
highlightCharacterOverflow()
|
highlightCharacterOverflow()
|
||||||
|
|
||||||
//setting the value and firing control event
|
//setting the value and firing control event
|
||||||
value = textView.text
|
text = textView.text
|
||||||
sendActions(for: .valueChanged)
|
sendActions(for: .valueChanged)
|
||||||
} else {
|
} else {
|
||||||
textView.text.removeLast()
|
textView.text.removeLast()
|
||||||
@ -311,7 +313,7 @@ extension TextArea: UITextViewDelegate {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//setting the value and firing control event
|
//setting the value and firing control event
|
||||||
value = textView.text
|
text = textView.text
|
||||||
sendActions(for: .valueChanged)
|
sendActions(for: .valueChanged)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user