I'm creating a TextAreaRow() and adding a rule for max length, however it forces you to then add at least one character, even if the row is not required.
i.e.
TextAreaRow() {
$0.placeholder = "Question"
$0.textAreaHeight = .dynamic(initialTextViewHeight: 100)
$0.add(rule: RuleMaxLength(maxLength: 300))
}
Will not validate with more than 300 characters, but will also not validate if you enter no text.
Adding
$0.add(rule: RuleMinLength(minLength: 0))
Does not change anything.
This seems to be fixed in master branch code.
public func isValid(value: String?) -> ValidationError? {
guard let value = value else { return nil }
return value.characters.count > Int(max) ? validationError : nil
}
Which Eureka version are you using?
I think we my need to re-open this one. I am using 4.0.1, and looking at the same problem.
Seems like not working I've limited to 255 characters but allowed more than that.
Most helpful comment
I think we my need to re-open this one. I am using 4.0.1, and looking at the same problem.