-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ErrorStateMatcher for checkbox and slide-toggle #6591
Comments
The behavior seems to be different due to the |
Under the hood both form controls are having the For the input it just doesn't show up because the |
The <md-form-field>
<md-slide-toggle formControlName="termsToggle">
I agree to terms and conditions
</md-slide-toggle>
<md-error>You must agree</md-error>
</md-form-field> As I recall from point 1 of #4750 (comment), it was #4757 that "Moves the _isErrorState logic to the input child to avoid a circular dependency". cc @crisbeto too |
@willshowell Yeah I agree that this would be a nice way to handle errors here. In regards to the form field, I'm not sure how well it would play together since the |
I think the |
inside validators.d.ts there are 2 Required Validator, one for "any controls" and one for "checkbox controls" i think
|
It looks like the slide toggle now uses the |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Question/Bug
What is the expected behavior?
I don't know if the current is the right behavior but I see some discrepancies between the behaviors of the input and the slide-toggle.
Slide-toggle gets its errors even when is pristine or not touched. The input gets the errors only when is not pristine/touched or when you try to submit the form.
What is the current behavior & what are the steps to reproduce?
go to: https://plnkr.co/edit/uofeSTyA2xAHEHR8RMq0?p=preview
and simply look at the difference.
The slide-toggle already has its errors.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
angular version: 4.3.5
material version: 2.0.0-beta.8-6cdbf36
Is there anything else we should know?
Am I missing something? Is this the right procedure? Don't you think it is better to create a container like md-input-container for the checkbox and slide-toggle?
The text was updated successfully, but these errors were encountered: