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