fixed keyboard issue
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
9d19464b57
commit
675fbf8693
@ -158,16 +158,17 @@ open class DropdownSelect: EntryFieldBase {
|
|||||||
optionsPicker.isHidden = true
|
optionsPicker.isHidden = true
|
||||||
dropdownField.inputView = optionsPicker
|
dropdownField.inputView = optionsPicker
|
||||||
dropdownField.inputAccessoryView = {
|
dropdownField.inputAccessoryView = {
|
||||||
let inputToolbar = UIToolbar().with {
|
let accessView = UIView(frame: .init(origin: .zero, size: .init(width: UIScreen.main.bounds.width, height: 44)))
|
||||||
$0.barStyle = .default
|
accessView.backgroundColor = .white
|
||||||
$0.isTranslucent = true
|
accessView.addBorder(side: .top, width: 1, color: .lightGray)
|
||||||
$0.items=[
|
let done = UIButton(type: .system)
|
||||||
UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.flexibleSpace, target: self, action: nil),
|
done.setTitle("Done", for: .normal)
|
||||||
UIBarButtonItem(title: "Done", style: UIBarButtonItem.Style.done, target: self, action: #selector(pickerDoneClicked))
|
done.translatesAutoresizingMaskIntoConstraints = false
|
||||||
]
|
done.addTarget(self, action: #selector(pickerDoneClicked), for: .touchUpInside)
|
||||||
}
|
accessView.addSubview(done)
|
||||||
inputToolbar.sizeToFit()
|
done.pinCenterY()
|
||||||
return inputToolbar
|
.pinTrailing(16)
|
||||||
|
return accessView
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// tap gesture
|
// tap gesture
|
||||||
@ -348,6 +349,22 @@ 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 {
|
||||||
|
return dropdownField.canBecomeFirstResponder
|
||||||
|
}
|
||||||
|
|
||||||
|
open override func becomeFirstResponder() -> Bool {
|
||||||
|
return dropdownField.becomeFirstResponder()
|
||||||
|
}
|
||||||
|
|
||||||
|
open override var canResignFirstResponder: Bool {
|
||||||
|
return dropdownField.canResignFirstResponder
|
||||||
|
}
|
||||||
|
|
||||||
|
open override func resignFirstResponder() -> Bool {
|
||||||
|
return dropdownField.resignFirstResponder()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -55,17 +55,17 @@ open class TextField: UITextField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
open func initialSetup() {
|
open func initialSetup() {
|
||||||
let doneToolbar: UIToolbar = UIToolbar()
|
let accessView = UIView(frame: .init(origin: .zero, size: .init(width: UIScreen.main.bounds.width, height: 44)))
|
||||||
doneToolbar.translatesAutoresizingMaskIntoConstraints = false
|
accessView.backgroundColor = .white
|
||||||
doneToolbar.barStyle = .default
|
accessView.addBorder(side: .top, width: 1, color: .lightGray)
|
||||||
|
let done = UIButton(type: .system)
|
||||||
let flexSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
|
done.setTitle("Done", for: .normal)
|
||||||
let done: UIBarButtonItem = UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(self.doneButtonAction))
|
done.translatesAutoresizingMaskIntoConstraints = false
|
||||||
done.accessibilityHint = "Double tap to finish editing."
|
done.addTarget(self, action: #selector(doneButtonAction), for: .touchUpInside)
|
||||||
doneToolbar.items = [flexSpace, done]
|
accessView.addSubview(done)
|
||||||
doneToolbar.sizeToFit()
|
done.pinCenterY()
|
||||||
|
.pinTrailing(16)
|
||||||
inputAccessoryView = doneToolbar
|
inputAccessoryView = accessView
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func doneButtonAction() {
|
@objc func doneButtonAction() {
|
||||||
|
|||||||
@ -104,19 +104,17 @@ open class TextView: UITextView, ViewProtocol {
|
|||||||
|
|
||||||
|
|
||||||
open func setup() {
|
open func setup() {
|
||||||
translatesAutoresizingMaskIntoConstraints = false
|
let accessView = UIView(frame: .init(origin: .zero, size: .init(width: UIScreen.main.bounds.width, height: 44)))
|
||||||
let doneToolbar: UIToolbar = UIToolbar()
|
accessView.backgroundColor = .white
|
||||||
doneToolbar.translatesAutoresizingMaskIntoConstraints = false
|
accessView.addBorder(side: .top, width: 1, color: .lightGray)
|
||||||
doneToolbar.barStyle = .default
|
let done = UIButton(type: .system)
|
||||||
|
done.setTitle("Done", for: .normal)
|
||||||
let flexSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
|
done.translatesAutoresizingMaskIntoConstraints = false
|
||||||
let done: UIBarButtonItem = UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(self.doneButtonAction))
|
done.addTarget(self, action: #selector(doneButtonAction), for: .touchUpInside)
|
||||||
done.accessibilityHint = "Double tap to finish editing."
|
accessView.addSubview(done)
|
||||||
doneToolbar.items = [flexSpace, done]
|
done.pinCenterY()
|
||||||
doneToolbar.sizeToFit()
|
.pinTrailing(16)
|
||||||
|
inputAccessoryView = accessView
|
||||||
inputAccessoryView = doneToolbar
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func doneButtonAction() {
|
@objc func doneButtonAction() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user