Closed odahcam closed 6 years ago
You're right. I usually use it like this:
`
`
Select2's own docs say the best way to ensure proper width is to set width: 100% via a style attribute on the original select element, but if the w-100 class works, then great!
All right, but if I'm using form control, I expect the field to be 100% width, as it would be in Bootstrap 4 or 3. Also, style
attribute is not a good practice.
Hy everyone,
I'm just sharing with you all the only way I fix that:
span.select2-container{
width: auto !important;
}
I'm not sure if it is the best way, but works fine ;)
Select2 sets the element with to a size in pixels, but in Bootstrap, by default, all inputs are 100% width, save in exception the checkbox, radius, etc for obvius reasons. 😆