8000 minor #27886 [Form] Removed .form-control-label class. (vudaltsov) · symfony/symfony@55ddaee · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 55ddaee

Browse files
minor #27886 [Form] Removed .form-control-label class. (vudaltsov)
This PR was squashed before being merged into the 3.4 branch (closes #27886). Discussion ---------- [Form] Removed .form-control-label class. | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | There is no such a class neither in [bootstrap 4.0](https://getbootstrap.com/docs/4.0/components/forms/#form-controls) nor in [bootstrap 4.1](https://getbootstrap.com/docs/4.1/components/forms/#form-controls). Commits ------- cb3e712 [Form] Removed .form-control-label class.
2 parents 5c74952 + cb3e712 commit 55ddaee

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
{%- set element = 'legend' -%}
188188
{%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' col-form-label')|trim}) -%}
189189
{%- else -%}
190-
{%- set label_attr = label_attr|merge({for: id, class: (label_attr.class|default('') ~ ' form-control-label')|trim}) -%}
190+
{%- set label_attr = label_attr|merge({for: id}) -%}
191191
{%- endif -%}
192192
{% if required -%}
193193
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %}

src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function testLabelDoesNotRenderFieldAttributes()
7272
$this->assertMatchesXpath($html,
7373
'/label
7474
[@for="name"]
75-
[@class="col-form-label col-sm-2 form-control-label required"]
75+
[@class="col-form-label col-sm-2 required"]
7676
'
7777
);
7878
}
@@ -89,7 +89,7 @@ public function testLabelWithCustomAttributesPassedDirectly()
8989
$this->assertMatchesXpath($html,
9090
'/label
9191
[@for="name"]
92-
[@class="my&class col-form-label col-sm-2 form-control-label required"]
92+
[@class="my&class col-form-label col-sm-2 required"]
9393
'
9494
);
9595
}
@@ -106,7 +106,7 @@ public function testLabelWithCustomTextAndCustomAttributesPassedDirectly()
106106
$this->assertMatchesXpath($html,
107107
'/label
108108
[@for="name"]
109-
[@class="my&class col-form-label col-sm-2 form-control-label required"]
109+
[@class="my&class col-form-label col-sm-2 required"]
110110
[.="[trans]Custom label[/trans]"]
111111
'
112112
);
@@ -126,7 +126,7 @@ public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly
126126
$this->assertMatchesXpath($html,
127127
'/label
128128
[@for="name"]
129-
[@class="my&class col-form-label col-sm-2 form-control-label required"]
129+
[@class="my&class col-form-label col-sm-2 required"]
130130
[.="[trans]Custom label[/trans]"]
131131
'
132132
);

src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testLabelDoesNotRenderFieldAttributes()
8181
$this->assertMatchesXpath($html,
8282
'/label
8383
[@for="name"]
84-
[@class="form-control-label required"]
84+
[@class="required"]
8585
'
8686
);
8787
}
@@ -98,7 +98,7 @@ public function testLabelWithCustomAttributesPassedDirectly()
9898
$this->assertMatchesXpath($html,
9999
'/label
100100
[@for="name"]
101-
[@class="my&class form-control-label required"]
101+
[@class="my&class required"]
102102
'
103103
);
104104
}
@@ -115,7 +115,7 @@ public function testLabelWithCustomTextAndCustomAttributesPassedDirectly()
115115
$this->assertMatchesXpath($html,
116116
'/label
117117
[@for="name"]
118-
[@class="my&class form-control-label required"]
118+
[@class="my&class required"]
119119
[.="[trans]Custom label[/trans]"]
120120
'
121121
);
@@ -135,7 +135,7 @@ public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly
135135
$this->assertMatchesXpath($html,
136136
'/label
137137
[@for="name"]
138-
[@class="my&class form-control-label required"]
138+
[@class="my&class required"]
139139
[.="[trans]Custom label[/trans]"]
140140
'
141141
);

0 commit comments

Comments
 (0)
0