Closed ena1106 closed 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.
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.
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.
Thank you!
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.
Using this library, if the form-control class is applied to the
element it is automatically applied also to the dropdown toggle button. I found the code for this here:
Can you explain why? In my project this causes me issues, since it overrides the background of the toggle button. But I guess you had a good reason for this choice.