There seems to be a bug in angular material causing the ng-messages to disappear in an unexpected way.
Applying ng-messages and validation to a form, the error messages do not show up properly when both required and minlength are set. The user remains confused about why his input is invalid.
Plunker:
https://plnkr.co/edit/7omwpbT3Y5h9VoasVMX4?p=preview
steps to reproduce:
Angular Versions:
Additional Information:
Looks like it is fixed in 1.1.0-RC5. See the Errors input demo on Angular-Material website. The last field has multiple error cases.
The problem is not about multiple error cases but especially the combination of minlength and required.
However, I figured out from that demo the attribute md-auto-hide is set to false for ng-messages, that did the job for my problem for now... it's still just a workaround, though.
@ThomasBurleson I also had a PR for that, but @topherfangio said, that he is already working on that.
@ThomasBurleson @DevVersion Indeed I have a branch that fixes it, but we were debating whether or not to use Protractor or Karma to write the necessary tests. Did we ever come to a conclusion on that?
Karma is preferred since we really do not have Protractor tests configured and I am not sure we want to open that "pandora box"
@ThomasBurleson Let me reference my PR (#7583) here, so we can take a look at a possible fix.
@topherfangio Cool looking forward seeing the tests :smile: . When can we expect to see some changes?
+1
It seems this does not only happen with requried and minlength. For me it happened with required and email. I assume it'll happen with any combination of validation messages.
@ThomasBurleson Also seems to me this is a huge use case. Don't know how this can be placed in Backlog...
@topherfangio Is there progress on this?
Most helpful comment
+1
It seems this does not only happen with
requriedandminlength. For me it happened withrequiredandemail. I assume it'll happen with any combination of validation messages.@ThomasBurleson Also seems to me this is a huge use case. Don't know how this can be placed in Backlog...
@topherfangio Is there progress on this?