Skip to content

[Twig][Bridge] force space between widget and label in checkbox_radio_label #15446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@
{% set label = name|humanize %}
{% endif %}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
{{- widget|raw -}}
{{- label is not sameas(false) ? label|trans({}, translation_domain) -}}
{{- widget|raw }} {{ label is not sameas(false) ? label|trans({}, translation_domain) -}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be same as now that sameas is deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be made in this PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, this has been fixed in the meantime in 99a1fcc.

</label>
{% endif %}
{% endblock checkbox_radio_label %}
Expand Down
26 changes: 13 additions & 13 deletions src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function testCheckedCheckbox()
[@class="checkbox"]
[
./label
[.="[trans]Name[/trans]"]
[.=" [trans]Name[/trans]"]
[
./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class"][@checked="checked"][@value="1"]
]
Expand All @@ -180,7 +180,7 @@ public function testUncheckedCheckbox()
[@class="checkbox"]
[
./label
[.="[trans]Name[/trans]"]
[.=" [trans]Name[/trans]"]
[
./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class"][not(@checked)]
]
Expand All @@ -200,7 +200,7 @@ public function testCheckboxWithValue()
[@class="checkbox"]
[
./label
[.="[trans]Name[/trans]"]
[.=" [trans]Name[/trans]"]
[
./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class"][@value="foo&bar"]
]
Expand Down Expand Up @@ -557,7 +557,7 @@ public function testSingleChoiceExpanded()
[@class="radio"]
[
./label
[.="[trans]Choice&A[/trans]"]
[.=" [trans]Choice&A[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
]
Expand All @@ -566,7 +566,7 @@ public function testSingleChoiceExpanded()
[@class="radio"]
[
./label
[.="[trans]Choice&B[/trans]"]
[.=" [trans]Choice&B[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
]
Expand All @@ -593,7 +593,7 @@ public function testSingleChoiceExpandedWithPlaceholder()
[@class="radio"]
[
./label
[.="[trans]Test&Me[/trans]"]
[.=" [trans]Test&Me[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_placeholder"][not(@checked)]
]
Expand All @@ -602,7 +602,7 @@ public function testSingleChoiceExpandedWithPlaceholder()
[@class="radio"]
[
./label
[.="[trans]Choice&A[/trans]"]
[.=" [trans]Choice&A[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_0"][@checked]
]
Expand All @@ -611,7 +611,7 @@ public function testSingleChoiceExpandedWithPlaceholder()
[@class="radio"]
[
./label
[.="[trans]Choice&B[/trans]"]
[.=" [trans]Choice&B[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
]
Expand All @@ -637,7 +637,7 @@ public function testSingleChoiceExpandedWithBooleanValue()
[@class="radio"]
[
./label
[.="[trans]Choice&A[/trans]"]
[.=" [trans]Choice&A[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_0"][@checked]
]
Expand All @@ -646,7 +646,7 @@ public function testSingleChoiceExpandedWithBooleanValue()
[@class="radio"]
[
./label
[.="[trans]Choice&B[/trans]"]
[.=" [trans]Choice&B[/trans]"]
[
./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
]
Expand All @@ -673,7 +673,7 @@ public function testMultipleChoiceExpanded()
[@class="checkbox"]
[
./label
[.="[trans]Choice&A[/trans]"]
[.=" [trans]Choice&A[/trans]"]
[
./input[@type="checkbox"][@name="name[]"][@id="name_0"][@checked][not(@required)]
]
Expand All @@ -682,7 +682,7 @@ public function testMultipleChoiceExpanded()
[@class="checkbox"]
[
./label
[.="[trans]Choice&B[/trans]"]
[.=" [trans]Choice&B[/trans]"]
[
./input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)]
]
Expand All @@ -691,7 +691,7 @@ public function testMultipleChoiceExpanded()
[@class="checkbox"]
[
./label
[.="[trans]Choice&C[/trans]"]
[.=" [trans]Choice&C[/trans]"]
[
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
]
Expand Down