lordfriend / nya-bootstrap-select

An AngularJS select replacement which build select like dropdown component with collection and ng-model support
http://nya.io/nya-bootstrap-select/
MIT License
178 stars 81 forks source link

form-control class added to dropdown toggle button #140

Closed ena1106 closed 8 years ago

ena1106 commented 8 years ago

In the original bs-select library I noticed that the form-control class is not applied to the generated dropdown toggle button. It is left in the outer div only.

<div class="btn-group bootstrap-select bs-select form-control">
    <button type="button" class="btn dropdown-toggle btn-default" data-toggle="dropdown" title="Select CFU" aria-expanded="false">

Using this library, if the form-control class is applied to the

lordfriend commented 8 years ago

form-control class will give the button width value 100% when you need use nyaBsSelect in an form-horizontal form.

https://github.com/twbs/bootstrap/blob/master/less/forms.less#L116

if you don't need the style of form-control, just don't use this class. it's not mandatory.

ena1106 commented 8 years ago

I didn't explain myself well. I need the form-control class, but from what I can see it's ok to have it just in the parent element, that in my case is: <ul class="form-control nya-bs-select" ... If I comment out the lines that assign the class also to the button, all is working well anyway, since the width 100% is given to the button anyway from the css:

.nya-bs-select .dropdown-toggle {
    width: 100%;
    padding-right: 25px;
}

My only concern here is that the original library, with the bs-select class, is not assigning the form-control class to the button element too. Sorry if I'm missing something.

lordfriend commented 8 years ago

I have investigated the whole project. Still can't figure out why I add this line of code. But I think you're right. The form-control class is not necessary for the dropdown toggle button. And remove this class won't break current example.

ena1106 commented 8 years ago

Thank you!