fixed bug in InputField/TextArea after refactor

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-04-09 16:19:11 -05:00
parent b07c010888
commit 994feff20e
2 changed files with 9 additions and 5 deletions

View File

@ -78,11 +78,13 @@ open class InputField: EntryFieldBase, UITextFieldDelegate {
/// Representing the type of input. /// Representing the type of input.
open var fieldType: FieldType = .text { didSet { setNeedsUpdate() } } open var fieldType: FieldType = .text { didSet { setNeedsUpdate() } }
/// The text of this textField. /// The text of this TextField.
private var _text: String?
open var text: String? { open var text: String? {
get { textField.text } get { _text }
set { set {
if let newValue, newValue != text { if let newValue, newValue != _text {
_text = newValue
textField.text = newValue textField.text = newValue
value = newValue value = newValue
} }

View File

@ -107,10 +107,12 @@ open class TextArea: EntryFieldBase {
} }
/// The text of this TextArea. /// The text of this TextArea.
private var _text: String?
open var text: String? { open var text: String? {
get { textView.text } get { _text }
set { set {
if let newValue, newValue != text { if let newValue, newValue != _text {
_text = newValue
textView.text = newValue textView.text = newValue
value = newValue value = newValue
} }