You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
When you enter the form, and tab through the fields, without actually changing anything, errors should be thrown. Now the errors are only shown after a user changes a field. Validations should be verified on blur.
The text was updated successfully, but these errors were encountered:
Yeah, this is a big question. I arbitrarily decided that the errors should appear red after the form is invalid and dirty.
Making it red after the form is touched & invalid sounds better.
We should provide a way to customize this, though. Thoughts on an API?
@ajoslin Well, the color should be the alert color for the theme right? And an error should be in that color, so there is no issue there. (I have an issue with them appearing before the users touched a field, but I separated that one out #1266)
I think the md-errored api is a good idea, as long as indeed the default is $invalid && $touched. If an field is invalid, and a user has touched the field, the error should be visible. In the current situation, an user can tab trough the entire form without getting a clue something is off. I don't think that is a good idea.
IMO, errors should always be displayed as errors (i.e. red or whatever color indicates an error). The developer should decide when to show the errors (e.g. ngIf="myInput.$touched").
Providing a sensible default for that and allowing the developer to customize it, would be ideal. E.g.:
I created this sample on plunker to demonstrate a few issues I'm having with forms.
When you enter the form, and tab through the fields, without actually changing anything, errors should be thrown. Now the errors are only shown after a user changes a field. Validations should be verified on blur.
The text was updated successfully, but these errors were encountered: