Skip to content

Commit

Permalink
Merge pull request #238 from braincrafted/empty-value
Browse files Browse the repository at this point in the history
Add empty value in empty_value option. Fixes #231
  • Loading branch information
Florian Eckerstorfer committed May 29, 2014
2 parents a79602a + 9b8dcd7 commit c1fae54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Resources/views/Form/bootstrap.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@

<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
{% if empty_value is not none %}
<option {% if required %} disabled="disabled"{% if value is empty %} selected="selected"{% endif %}{% else %} value=""{% endif %}>{{ empty_value|trans({}, translation_domain) }}</option>
<option {% if required %} disabled="disabled"{% if value is empty %} selected="selected"{% endif %}{% endif %} value="">{{ empty_value|trans({}, translation_domain) }}</option>
{% endif %}
{% if preferred_choices|length > 0 %}
{% set options = preferred_choices %}
Expand Down

0 comments on commit c1fae54

Please sign in to comment.