When the user is typing email : If the email is not in Regex format then it should the error ("invalid") automatically and when the email is again edited in Regex format then the error must be removed automatically while editing. Is it possible to do using this library ??
Just like as shown in screenshots below for Email field :


You can do this using the delegation methods associated with the TextField. There is not a validation check for the values added, at least not at the moment. It would be a good feature though, and has been noted prior. I will add a feature request tag to this and make a sample or build it into Material. Thank you!
@danieldahan @Maddy10
Just wanted to add my two cents 馃槃
Validation should live outside of the framework as there are too many types of fields and validations. Ideally you would have a protocol to enable such functionality.
protocol TextFieldValidator {
func validateTextField()
}
protocol EmailTextFieldValidator: TextFieldValidator {}
protocol PhoneTextFieldValidator: TextFieldValidator {}
Then you can conform to your protocol when you need to validate a specific field and implement the validateTextField signature.
This also ensures that you keep your code dry and don't create needless subclasses of TextField.
Let me know if this makes sense - otherwise I can make a sample.
Best!
I agree @adamdahan. Are you suggesting to leave this outside of Material for now?
Made PR for this #1082
I am going to close this issue as the PR is merged in. Let's focus on tomorrow making a release.