angular-ui / ui-select

AngularJS-native version of Select2 and Selectize
MIT License
3.26k stars 1.82k forks source link

Display issue with selectize theme + multiple + required #1889

Open SaintFlipper opened 7 years ago

SaintFlipper commented 7 years ago

Not sure that this is the same as previous issues with ui-select + multiple + required (eg. #258). Issue is that with <ui-select theme="selectize" multiple ng-required="true" ...> the control doesn't display the expected red 'invalid' border initially. Adding an item then removing it again then shows the red border. It looks like it's related to the ng-dirty style against the created parent ui-select-container DIV. If you manually add that style in FF/Chrome devtools then the red border shows up.

See: http://plnkr.co/edit/Iqb6fx0LUqupBUIS3xIL?p=preview

Other similar issues such as #258 seem to relate to ng-empty or ng-invalid not being set, but devtools shows that these are correctly set here. This seems to be a styling thing.

Note also that with theme="bootstrap" even adding then removing items doesn't highlight the empty field. Maybe that's a different issue, but seems likely to be closely related.

Jefiozie commented 7 years ago

hi @SaintFlipper , why should do border be there initially? Can you explain this then I have a better understanding of what you mean.

Thanks.

SaintFlipper commented 7 years ago

Hi @Jefiozie, I just mean the red border associated with the ng-invalid style, and which would be displayed for an Angular control which has ng-required="true" but is blank/empty. I've updated the plunker at: http://plnkr.co/edit/gPpMBftou8FlxSLIcmo2?p=preview to clarify this with a thicker border. The second input is a simple text field with ng-required="true", and it shows the thick red border until some text is entered, at which point the border changes to green (the ng-valid style). However the ui-select+selectize input field at the top is also blank, but doesn't show the red border until something is added then removed again (even then it doesn't seem to use the defined ng-invalid style as the red border looks like it's only 1 pixel thick). Thanks.

Jefiozie commented 7 years ago

It looks like it has something to do with the selectize-input css class. Could you investigate it a little bit further?