fixed logic in showError/showSuccess

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-12-08 18:10:52 -06:00
parent bc4f0e8915
commit 0842998c97

View File

@ -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