I'm using https://github.com/mbenford/ngTagsInput.
I created a basic form with a url and a tag-input field that is required.
Since it's required, i used the attribute min-tags="1"
I used it in conjonction with bootstrap stylehseet.
When displayed, the field appears with a red shadow border (since it is empty), even before any submit of the form. This is really annoying, is there any workaround ?
Thank you
Edit : sample code :
<tags-input min-tags="1" ng-model="mytags"></tags-input>
Have done a plunker : http://plnkr.co/edit/EQcYfr4vLpkeJESho3GL?p=preview
You can simply use a custom class to handle the pristine state:
CSS
.custom-tags.ng-pristine .tags {
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
border: 1px solid #ccc
}
HTML
<tags-input min-tags="1" ng-model="mytags" class="custom-tags"></tags-input>
Working Plunker
Also, Angular 1.3 isn't officially supported yet. This is particularly important here because both pristine and dirty states won't be correctly set if you use that version of the framework.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With