8000 minor #22845 [Form][3.3] avoid double blanks while rendering form att… · symfony/symfony@cbd2561 · GitHub
[go: up one dir, main page]

Skip to content

Commit cbd2561

Browse files
minor #22845 [Form][3.3] avoid double blanks while rendering form attributes (craue)
This PR was merged into the 3.3 branch. Discussion ---------- [Form][3.3] avoid double blanks while rendering form attributes | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | kind of | New feature? | no | BC breaks? | no (rather reverts one) | Deprecations? | no | Tests pass? | we'll see | Fixed tickets | -- | License | MIT | Doc PR | -- This fix avoids the double blanks introduced by #20365 when using the Twig template. The `attributes` block already renders one blank before each attribute, so there's no need to add another one prior to calling the block. Commits ------- a9c11c9 avoid double blanks while rendering form attributes
2 parents 2f4dea5 + a9c11c9 commit cbd2561

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
{{- block('choice_widget_options') -}}
8080
</optgroup>
8181
{%- else -%}
82-
<option value="{{ choice.value }}"{% if choice.attr %} {% with { attr: choice.attr } %}{{ block('attributes') }}{% endwith %}{% endif %}{% if choice is selectedchoice(value) %} selected="selected"{% endif %}>{{ choice_translation_domain is same as(false) ? choice.label : choice.label|trans({}, choice_translation_domain) }}</option>
82+
<option value="{{ choice.value }}"{% if choice.attr %}{% with { attr: choice.attr } %}{{ block('attributes') }}{% endwith %}{% endif %}{% if choice is selectedchoice(value) %} selected="selected"{% endif %}>{{ choice_translation_domain is same as(false) ? choice.label : choice.label|trans({}, choice_translation_domain) }}</option>
8383
{%- endif -%}
8484
{% endfor %}
8585
{%- endblock choice_widget_options -%}
@@ -259,7 +259,7 @@
259259
6DCC {% set label = name|humanize %}
260260
{%- endif -%}
261261
{%- endif -%}
262-
<label{% if label_attr %} {% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</label>
262+
<label{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</label>
263263
{%- endif -%}
264264
{%- endblock form_label -%}
265265

0 commit comments

Comments
 (0)
0