From 0842998c97d900454801a01c1727f9b1d594ae61 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 8 Dec 2022 18:10:52 -0600 Subject: [PATCH] fixed logic in showError/showSuccess Signed-off-by: Matt Bruce --- .../TextEntryField/TextEntryField.swift | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/VDS/Components/TextFields/TextEntryField/TextEntryField.swift b/VDS/Components/TextFields/TextEntryField/TextEntryField.swift index 5d9866fe..92cf1cc6 100644 --- a/VDS/Components/TextFields/TextEntryField/TextEntryField.swift +++ b/VDS/Components/TextFields/TextEntryField/TextEntryField.swift @@ -52,8 +52,28 @@ open class TextEntryFieldBase: EntryField { open var type: TextEntryFieldType = .text { didSet { didChange() }} - open var showSuccess: Bool = false { didSet { didChange() }} - + var _showError: Bool = false + open override var showError: Bool { + get { _showError } + set { + if !showSuccess && _showError != newValue { + _showError = newValue + didChange() + } + } + } + + var _showSuccess: Bool = false + open var showSuccess: Bool { + get { _showSuccess } + set { + if !showError && _showSuccess != newValue { + _showSuccess = newValue + didChange() + } + } + } + open override var state: UIControl.State { get { var state = super.state