Skip to content

Commit

Permalink
Merge pull request #32 from mnowaczyk/master
Browse files Browse the repository at this point in the history
Append empty option if allow_clear set to true - required by select2.js
  • Loading branch information
tetranz authored Apr 12, 2017
2 parents 4b449a0 + 19cc9c7 commit fff2fea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Resources/views/Form/fields.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
{% spaceless %}
<select {{ block('widget_attributes') }}>
{% if value is iterable %}
{% if allow_clear %}
<option value=""></option>
{% endif %}
{% for id, label in value %}
{% block tetranz_select2entity_widget_select_option %}
<option value="{{ id }}" selected="selected">{{ label }}</option>
Expand Down

0 comments on commit fff2fea

Please sign in to comment.