I'm using Selectize.js in my project to add searchable select controls.
For example
HTML:
<select placeholder="Choose an option..." class="selectize">
<option>Option 1</option>
<option>Option 2</option>
</select>
Javascript:
$(document).ready(function(){
$('.selectize').selectize();
});
I want the option list to be the width of the largest element. I can achieve this with css
.selectize-dropdown {
width: auto !important;
}
But then, how can I make the input box the same width as the option list?
I'm using this fiddle for tests (please ignore the css setting the width of div).