move the drop down action to field input dismissal.
This commit is contained in:
parent
68274505fb
commit
84cb198057
@ -86,6 +86,11 @@ import UIKit
|
|||||||
dropDownCaretView.setOptional(with: model.caretView, delegateObject, additionalData)
|
dropDownCaretView.setOptional(with: model.caretView, delegateObject, additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override func dismissFieldInput(_ sender: Any?) {
|
||||||
|
performDropdownAction()
|
||||||
|
super.dismissFieldInput(sender)
|
||||||
|
}
|
||||||
|
|
||||||
func performDropdownAction() {
|
func performDropdownAction() {
|
||||||
if let actionModel = baseDropdownEntryFieldModel?.action, let actionMap = actionModel.toJSON() {
|
if let actionModel = baseDropdownEntryFieldModel?.action, let actionMap = actionModel.toJSON() {
|
||||||
var additionalData = self.additionalData ?? [:]
|
var additionalData = self.additionalData ?? [:]
|
||||||
|
|||||||
@ -106,7 +106,6 @@ import UIKit
|
|||||||
@objc public override func dismissFieldInput(_ sender: Any?) {
|
@objc public override func dismissFieldInput(_ sender: Any?) {
|
||||||
|
|
||||||
setTextWith(date: datePicker?.date)
|
setTextWith(date: datePicker?.date)
|
||||||
performDropdownAction()
|
|
||||||
super.dismissFieldInput(sender)
|
super.dismissFieldInput(sender)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,8 +32,6 @@ open class ItemDropdownEntryField: BaseDropdownEntryField {
|
|||||||
return model as? ItemDropdownEntryFieldModel
|
return model as? ItemDropdownEntryFieldModel
|
||||||
}
|
}
|
||||||
|
|
||||||
private var systemWillSetItem = false
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -112,9 +110,7 @@ open class ItemDropdownEntryField: BaseDropdownEntryField {
|
|||||||
setPickerDelegates(delegate: self)
|
setPickerDelegates(delegate: self)
|
||||||
|
|
||||||
if let pickerView = pickerView, let index = model.selectedIndex {
|
if let pickerView = pickerView, let index = model.selectedIndex {
|
||||||
systemWillSetItem = true
|
|
||||||
self.pickerView(pickerView, didSelectRow: index, inComponent: 0)
|
self.pickerView(pickerView, didSelectRow: index, inComponent: 0)
|
||||||
systemWillSetItem = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -142,9 +138,6 @@ extension ItemDropdownEntryField: UIPickerViewDelegate, UIPickerViewDataSource {
|
|||||||
observeDropdownChange?(text ?? "", pickerData[row])
|
observeDropdownChange?(text ?? "", pickerData[row])
|
||||||
text = pickerData[row]
|
text = pickerData[row]
|
||||||
itemDropdownEntryFieldModel?.selectedIndex = row
|
itemDropdownEntryFieldModel?.selectedIndex = row
|
||||||
if !systemWillSetItem {
|
|
||||||
performDropdownAction()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user