Signed-off-by: Matt Bruce <matt.bruce@verizon.com>

This commit is contained in:
Matt Bruce 2024-02-29 10:44:53 -06:00
commit 01052ebefd

View File

@ -261,7 +261,7 @@ open class TextArea: EntryFieldBase {
open func highlightCharacterOverflow() {
let count = textView.text.count
guard let maxLength, count > maxLength else {
guard let maxLength, maxLength > 0, count > maxLength else {
textView.textAttributes = nil
return
}
@ -327,12 +327,11 @@ extension TextArea: UITextViewDelegate {
//The exceeding characters will be highlighted to help users correct their entry.
if ((maxLength ?? 0) > 0) {
if textView.text.count <= allowCharCount {
highlightCharacterOverflow()
//setting the value and firing control event
value = textView.text
sendActions(for: .valueChanged)
if (textView.text.count > (maxLength ?? 0)) {
highlightCharacterOverflow()
}
} else {
textView.text.removeLast()
highlightCharacterOverflow()
@ -343,6 +342,7 @@ extension TextArea: UITextViewDelegate {
sendActions(for: .valueChanged)
}
}
}
/// Will move this into a new file, need to talk with Scott/Kyle