From 301ead74474f52670eac2d3945e88dbf2608f092 Mon Sep 17 00:00:00 2001 From: vasavk Date: Wed, 28 Feb 2024 22:03:17 +0530 Subject: [PATCH] Digital ACT-191 ONEAPP-6682 story: Fix for the observed crash on removing last char when having char counter and exceeded limit. --- VDS/Components/TextFields/TextArea/TextArea.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/VDS/Components/TextFields/TextArea/TextArea.swift b/VDS/Components/TextFields/TextArea/TextArea.swift index 92f5525a..432d24bd 100644 --- a/VDS/Components/TextFields/TextArea/TextArea.swift +++ b/VDS/Components/TextFields/TextArea/TextArea.swift @@ -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()