Digital ACT-191 ONEAPP-6682 story: fixed the bug dealing with the character counter

This commit is contained in:
vasavk 2024-02-29 00:45:54 +05:30
parent 301ead7447
commit a4582f11a5

View File

@ -251,7 +251,7 @@ open class TextArea: EntryFieldBase {
return countStr
} else {
showError = false
errorText = ""
errorText = nil
return ("\(countStr)" + "/" + "\(maxLength ?? 0)")
}
} else {
@ -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
}
@ -315,6 +315,7 @@ extension TextArea: UITextViewDelegate {
sendActions(for: .valueChanged)
}
}
}
/// Will move this into a new file, need to talk with Scott/Kyle