Wanted to add my solution here as well. This is similar to Ravindu's answer above.
I added width: 'resolve',
as a property within the select2:
$('#searchFilter').select2({
width: 'resolve',
});
Then I added a min-width
property to select2-container
with !important
:
.select2-container {
min-width: 100% !important;
}
On the select element, the style='100px !important;'
attribute needed !important
to work:
<select class="form-control" style="width: 160px;" id="searchFilter" name="searchfilter[]">