No Validate on Emoty
This commit is contained in:
parent
c4fa9188b4
commit
ac86d92574
@ -259,6 +259,7 @@ import UIKit
|
|||||||
observingTextFieldDelegate?.isInvalid?(textfield: self)
|
observingTextFieldDelegate?.isInvalid?(textfield: self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Executes on UITextField.textDidBeginEditingNotification
|
/// Executes on UITextField.textDidBeginEditingNotification
|
||||||
@objc func startEditing() {
|
@objc func startEditing() {
|
||||||
isSelected = true
|
isSelected = true
|
||||||
@ -278,6 +279,7 @@ import UIKit
|
|||||||
|
|
||||||
// Don't show error till user starts typing.
|
// Don't show error till user starts typing.
|
||||||
guard text?.count ?? 0 != 0 else {
|
guard text?.count ?? 0 != 0 else {
|
||||||
|
showError = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -71,7 +71,7 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
|
|||||||
|
|
||||||
/// The text of this textView.
|
/// The text of this textView.
|
||||||
open override var text: String? {
|
open override var text: String? {
|
||||||
get { return textView.text }
|
get { return textViewEntryFieldModel?.text }
|
||||||
set {
|
set {
|
||||||
textView.text = newValue
|
textView.text = newValue
|
||||||
textViewEntryFieldModel?.text = newValue
|
textViewEntryFieldModel?.text = newValue
|
||||||
@ -207,8 +207,19 @@ class TextViewEntryField: EntryField, UITextViewDelegate, ObservingTextFieldDele
|
|||||||
|
|
||||||
/// Executes on UITextView.textDidEndEditingNotification
|
/// Executes on UITextView.textDidEndEditingNotification
|
||||||
@objc func endInputing() {
|
@objc func endInputing() {
|
||||||
resignFirstResponder()
|
|
||||||
isSelected = false
|
isSelected = false
|
||||||
|
resignFirstResponder()
|
||||||
|
|
||||||
|
// Don't show error till user starts typing.
|
||||||
|
guard text?.count ?? 0 != 0 else {
|
||||||
|
showError = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if let isValid = (model as? TextEntryFieldModel)?.isValid {
|
||||||
|
self.isValid = isValid
|
||||||
|
}
|
||||||
|
|
||||||
showError = !isValid
|
showError = !isValid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user