Digital ACT-191 ONEAPP-6682 story: fixed the bug dealing with the character counter
This commit is contained in:
parent
301ead7447
commit
a4582f11a5
@ -251,7 +251,7 @@ open class TextArea: EntryFieldBase {
|
|||||||
return countStr
|
return countStr
|
||||||
} else {
|
} else {
|
||||||
showError = false
|
showError = false
|
||||||
errorText = ""
|
errorText = nil
|
||||||
return ("\(countStr)" + "/" + "\(maxLength ?? 0)")
|
return ("\(countStr)" + "/" + "\(maxLength ?? 0)")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -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
|
||||||
}
|
}
|
||||||
@ -315,6 +315,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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user