Skip to content

Commit 0ba5065

Browse files
DocFXnicolas-grekas
authored andcommitted
[TwigBridge] Provide a default non-empty label on empty options to validate HTML5
1 parent 51ab8b1 commit 0ba5065

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Resources/views/Form/form_div_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
{%- endif -%}
6262
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
6363
{%- if placeholder is not none -%}
64-
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder != '' ? (translation_domain is same as(false) ? placeholder : placeholder|trans({}, translation_domain)) }}</option>
64+
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder != '' ? (translation_domain is same as(false) ? placeholder : placeholder|trans({}, translation_domain)) : '--' }}</option>
6565
{%- endif -%}
6666
{%- if preferred_choices|length > 0 -%}
6767
{% set options = preferred_choices %}

0 commit comments

Comments
 (0)