Digital ACT-191 ONEAPP-6682 story: Fix for the observed crash on removing last char when having char counter and exceeded limit.

This commit is contained in:
vasavk 2024-02-28 22:03:17 +05:30
parent af2c5cd368
commit 301ead7447

View File

@ -300,12 +300,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()