tilwinjoy / angular-bootstrap-material

AngularJS directives for bootstrap material design components
http://tilwinjoy.github.io/angular-bootstrap-material
21 stars 13 forks source link

Error message is hidden when form control loses focus #14

Closed railsstudent closed 8 years ago

railsstudent commented 8 years ago

I observe that error message of form control is hidden when it loses focus. This behaviour does not match the requirement of the project i am currently working on.

Is it possible to retain the message when form control loses focus? This is the template code found in form-group.html

<div ng-show="showErrors" ng-messages="this['fg_'+$id].$error" ng-messages-multiple>
    <div ng-if="errorMessagesInclude" ng-messages-include="{{errorMessagesInclude}}"></div>
    <div ng-repeat="(key,value) in errorMessageMap">
      <!-- use ng-message-exp for a message whose key is given by an expression -->
      <div ng-message-exp="key" class="help-block">{{value}}</div>
    </div>
  </div>

Thanks,

Connie

tilwinjoy commented 8 years ago

Hi, as mentioned in contributiob guidelines this project doesn't handle any CSS on it's own. This is the behavior of bootstrap material design project. There is an issue related to this - FezVrasta/bootstrap-material-design#887. Please vote/voice your opinion/submit a PR in it.

As far as I remember this is handled via CSS selectors (Something like "hide all error messages, only display the errors inside has-focus parent") you can easily override it locally as well...