diff --git a/VDS/Components/TextFields/InputField/InputField.swift b/VDS/Components/TextFields/InputField/InputField.swift index 448dbbf1..b45500a0 100644 --- a/VDS/Components/TextFields/InputField/InputField.swift +++ b/VDS/Components/TextFields/InputField/InputField.swift @@ -78,11 +78,13 @@ open class InputField: EntryFieldBase, UITextFieldDelegate { /// Representing the type of input. 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? { - get { textField.text } + get { _text } set { - if let newValue, newValue != text { + if let newValue, newValue != _text { + _text = newValue textField.text = newValue value = newValue } diff --git a/VDS/Components/TextFields/TextArea/TextArea.swift b/VDS/Components/TextFields/TextArea/TextArea.swift index 3c1bbf56..73a1e67c 100644 --- a/VDS/Components/TextFields/TextArea/TextArea.swift +++ b/VDS/Components/TextFields/TextArea/TextArea.swift @@ -107,10 +107,12 @@ open class TextArea: EntryFieldBase { } /// The text of this TextArea. + private var _text: String? open var text: String? { - get { textView.text } + get { _text } set { - if let newValue, newValue != text { + if let newValue, newValue != _text { + _text = newValue textView.text = newValue value = newValue }