I've created a multiple select at the document ready with jQuery (.select2() function). The select works well, it has been created correctly, but the placeholder shows only a few chars. When I put in some data, and then I reset with the clear button, the placeholder is correctly shown. How can I fix this?
[This is my select with truncated placeholder at document ready]
[and here you can find the select with the right placeholder]
This is the jquery code:
$('#myselect').select2({
multiple: true,
allowClear: true,
placeholder: Translator.trans('label.pleaseSelect')
});
and this is my HTML
<select class="form-control" name="myName" id="myselect" style="width: 100% !important;" multiple>
<option></option>
{% for field in data.fields %}
<option value="{{ field['id'] }}" >{{ field['description'] }}</option>
{% endfor %}
</select>
Thanks for helping !