fixed issues with dropdown / inputField
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
1d5b631295
commit
9d19464b57
@ -171,10 +171,9 @@ open class DropdownSelect: EntryFieldBase {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
// tap gesture
|
// tap gesture
|
||||||
fieldStackView
|
containerView
|
||||||
.publisher(for: UITapGestureRecognizer())
|
.publisher(for: UITapGestureRecognizer())
|
||||||
.sink { [weak self] _ in
|
.sink { [weak self] _ in
|
||||||
print("touch occured")
|
|
||||||
self?.launchPicker()
|
self?.launchPicker()
|
||||||
}
|
}
|
||||||
.store(in: &subscribers)
|
.store(in: &subscribers)
|
||||||
@ -349,16 +348,6 @@ open class DropdownSelect: EntryFieldBase {
|
|||||||
titleLabelWidthConstraint?.constant = containerView.frame.width
|
titleLabelWidthConstraint?.constant = containerView.frame.width
|
||||||
titleLabelWidthConstraint?.isActive = helperTextPlacement == .right
|
titleLabelWidthConstraint?.isActive = helperTextPlacement == .right
|
||||||
}
|
}
|
||||||
|
|
||||||
open override var canBecomeFirstResponder: Bool { true }
|
|
||||||
|
|
||||||
open override func resignFirstResponder() -> Bool {
|
|
||||||
print("resign occurred")
|
|
||||||
if dropdownField.isFirstResponder {
|
|
||||||
dropdownField.resignFirstResponder()
|
|
||||||
}
|
|
||||||
return super.resignFirstResponder()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -374,6 +363,7 @@ extension DropdownSelect: UIPickerViewDelegate, UIPickerViewDataSource {
|
|||||||
dropdownField.resignFirstResponder()
|
dropdownField.resignFirstResponder()
|
||||||
}
|
}
|
||||||
optionsPicker.isHidden = !optionsPicker.isHidden
|
optionsPicker.isHidden = !optionsPicker.isHidden
|
||||||
|
updateContainerView()
|
||||||
}
|
}
|
||||||
|
|
||||||
public func numberOfComponents(in pickerView: UIPickerView) -> Int {
|
public func numberOfComponents(in pickerView: UIPickerView) -> Int {
|
||||||
|
|||||||
@ -307,7 +307,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Methods
|
// MARK: - Private Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
private func updateContainerView() {
|
internal func updateContainerView() {
|
||||||
containerView.backgroundColor = backgroundColorConfiguration.getColor(self)
|
containerView.backgroundColor = backgroundColorConfiguration.getColor(self)
|
||||||
containerView.layer.borderColor = isReadOnly ? readOnlyBorderColorConfiguration.getColor(self).cgColor : borderColorConfiguration.getColor(self).cgColor
|
containerView.layer.borderColor = isReadOnly ? readOnlyBorderColorConfiguration.getColor(self).cgColor : borderColorConfiguration.getColor(self).cgColor
|
||||||
containerView.layer.borderWidth = VDSFormControls.borderWidth
|
containerView.layer.borderWidth = VDSFormControls.borderWidth
|
||||||
|
|||||||
@ -323,21 +323,12 @@ open class InputField: EntryFieldBase {
|
|||||||
titleLabelWidthConstraint?.constant = containerView.frame.width
|
titleLabelWidthConstraint?.constant = containerView.frame.width
|
||||||
titleLabelWidthConstraint?.isActive = helperTextPlacement == .right
|
titleLabelWidthConstraint?.isActive = helperTextPlacement == .right
|
||||||
}
|
}
|
||||||
|
|
||||||
open override var canBecomeFirstResponder: Bool { true }
|
|
||||||
|
|
||||||
open override func resignFirstResponder() -> Bool {
|
|
||||||
if textField.isFirstResponder {
|
|
||||||
textField.resignFirstResponder()
|
|
||||||
}
|
|
||||||
return super.resignFirstResponder()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension InputField: UITextFieldDelegate {
|
extension InputField: UITextFieldDelegate {
|
||||||
public func textFieldDidBeginEditing(_ textField: UITextField) {
|
public func textFieldDidBeginEditing(_ textField: UITextField) {
|
||||||
fieldType.handler().textFieldDidBeginEditing(self, textField: textField)
|
fieldType.handler().textFieldDidBeginEditing(self, textField: textField)
|
||||||
setNeedsUpdate()
|
updateContainerView()
|
||||||
}
|
}
|
||||||
|
|
||||||
public func textFieldDidEndEditing(_ textField: UITextField) {
|
public func textFieldDidEndEditing(_ textField: UITextField) {
|
||||||
@ -349,8 +340,6 @@ extension InputField: UITextFieldDelegate {
|
|||||||
fieldType.handler().textFieldDidChangeSelection(self, textField: textField)
|
fieldType.handler().textFieldDidChangeSelection(self, textField: textField)
|
||||||
if fieldType.handler().validateOnChange {
|
if fieldType.handler().validateOnChange {
|
||||||
validate()
|
validate()
|
||||||
} else {
|
|
||||||
setNeedsUpdate()
|
|
||||||
}
|
}
|
||||||
sendActions(for: .valueChanged)
|
sendActions(for: .valueChanged)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user