revised selectabel

This commit is contained in:
Kevin G Christiano 2020-04-23 15:30:56 -04:00
parent aca32d14f7
commit 0defd2916a
4 changed files with 7 additions and 6 deletions

View File

@ -257,8 +257,10 @@ import UIKit
if let isLocked = model.locked { if let isLocked = model.locked {
self.isLocked = isLocked self.isLocked = isLocked
} else if let isSelected = model.selected { } else if (model.selected ?? false) && !model.wasInitiallySelected {
self.isSelected = isSelected
model.wasInitiallySelected = true
self.isSelected = true
} }
} }

View File

@ -30,6 +30,7 @@ import Foundation
public var fieldKey: String? public var fieldKey: String?
public var groupName: String = FormValidator.defaultGroupName public var groupName: String = FormValidator.defaultGroupName
public var baseValue: AnyHashable? public var baseValue: AnyHashable?
public var wasInitiallySelected: Bool = false
public var isValid: Bool? { public var isValid: Bool? {
didSet { updateUI?() } didSet { updateUI?() }

View File

@ -340,8 +340,7 @@ import UIKit
observingTextFieldDelegate = delegateObject?.observingTextFieldDelegate observingTextFieldDelegate = delegateObject?.observingTextFieldDelegate
setupTextFieldToolbar() setupTextFieldToolbar()
if isSelected && !model.wasInitiallySelected { if isSelected {
textEntryFieldModel?.wasInitiallySelected = true
startEditing() startEditing()
} }
} }

View File

@ -31,7 +31,6 @@
public var enabledTextColor: Color = Color(uiColor: .mvmBlack) public var enabledTextColor: Color = Color(uiColor: .mvmBlack)
public var disabledTextColor: Color = Color(uiColor: .mvmCoolGray3) public var disabledTextColor: Color = Color(uiColor: .mvmCoolGray3)
public var type: EntryType? public var type: EntryType?
public var wasInitiallySelected: Bool = false
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Keys // MARK: - Keys