refactored base for responder
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
beaa2b3a82
commit
891a816f55
@ -30,19 +30,7 @@ open class DropdownSelect: EntryFieldBase {
|
|||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Public Properties
|
// MARK: - Public Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// Override UIControl state to add the .error state if showSuccess is true and if showError is true.
|
|
||||||
open override var state: UIControl.State {
|
|
||||||
get {
|
|
||||||
var state = super.state
|
|
||||||
if dropdownField.isFirstResponder {
|
|
||||||
state.insert(.focused)
|
|
||||||
}
|
|
||||||
|
|
||||||
return state
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// If true, the label will be displayed inside the dropdown containerView. Otherwise, the label will be above the dropdown containerView like a normal text input.
|
/// If true, the label will be displayed inside the dropdown containerView. Otherwise, the label will be above the dropdown containerView like a normal text input.
|
||||||
open var showInlineLabel: Bool = false { didSet { setNeedsUpdate() }}
|
open var showInlineLabel: Bool = false { didSet { setNeedsUpdate() }}
|
||||||
|
|
||||||
|
|||||||
@ -207,6 +207,9 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
if isReadOnly {
|
if isReadOnly {
|
||||||
state.insert(.readonly)
|
state.insert(.readonly)
|
||||||
}
|
}
|
||||||
|
if let responder, responder.isFirstResponder {
|
||||||
|
state.insert(.focused)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
|
|||||||
@ -166,11 +166,7 @@ open class InputField: EntryFieldBase {
|
|||||||
if showSuccess {
|
if showSuccess {
|
||||||
state.insert(.success)
|
state.insert(.success)
|
||||||
}
|
}
|
||||||
|
|
||||||
if textField.isFirstResponder {
|
|
||||||
state.insert(.focused)
|
|
||||||
}
|
|
||||||
|
|
||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,18 +56,7 @@ open class TextArea: EntryFieldBase {
|
|||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Public Properties
|
// MARK: - Public Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// Override UIControl state to add the .error state if showSuccess is true and if showError is true.
|
|
||||||
open override var state: UIControl.State {
|
|
||||||
get {
|
|
||||||
var state = super.state
|
|
||||||
if textView.isFirstResponder {
|
|
||||||
state.insert(.focused)
|
|
||||||
}
|
|
||||||
return state
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override var containerSize: CGSize { CGSize(width: 182, height: Height.twoX.value) }
|
override var containerSize: CGSize { CGSize(width: 182, height: Height.twoX.value) }
|
||||||
|
|
||||||
/// Enum used to describe the the height of TextArea.
|
/// Enum used to describe the the height of TextArea.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user