-
Notifications
You must be signed in to change notification settings - Fork 3.4k
required error on md-select not prevent the submit event #8599
Comments
I believe the select works as intended. Your form doesn't submit when the text field is empty, because of the default browser Here's a fork of your Plunk: http://plnkr.co/edit/LBptzJyyIi24ZvIadVTM?p=preview. If you try to log the |
@crisbeto so i must add |
You can either add As for the red border, it will show up when the select is "dirty", e.g. if the user selected and then removed the value. You can see what that looks like in the "Validations" demo at the bottom. |
@crisbeto the css rule for the error message in |
I'm not sure really, it might have to do with UX, so an empty select doesn't get highlighted the first time the user opens the page. |
@crisbeto sorry, the css rule for the error message in md-input is |
I'm pretty sure that this is the intended behaviour. If you want to make it underline when the form is submitted, you can add this to your CSS: .ng-submitted md-select.ng-invalid .md-select-value{
color: rgb(221,44,0);
border-bottom-color: rgb(221,44,0);
} |
@crisbeto there is no way that this is what the UX team wants.. if you can ask them and make sure that this is the behaviour it will be great :) for now i will use the css you gave me |
Part of this issue appears related to #8529 which I am working on today. |
@crisbeto told you.. ;) |
Issue Fixed in version 1.13 thanks @topherfangio |
i have a form with ng-submit attribute and two inputs:
both of them are required
if the md-input is empty the submit is stopped (when you click the focus is set to the required input and a message pops on top of it)
if the md-select is empty the submit doesn't recognize it and goes through.
code example
Angular Versions:
The text was updated successfully, but these errors were encountered: