[Form] Remove extra .form-group wrapper around file widget in bootstrap 4
This is a follow-up to https://github.com/symfony/symfony/pull/27958 and https://github.com/symfony/symfony/pull/27919. It fixes an extra space between the help text of a FileType widget and the widget itself. The extra space was cause by a .form-group wrapper in the file_widget block.
This commit is contained in:
parent
f68cb81316
commit
01e7fe4fb0
@ -115,7 +115,6 @@
|
|||||||
{%- endblock percent_widget %}
|
{%- endblock percent_widget %}
|
||||||
|
|
||||||
{% block file_widget -%}
|
{% block file_widget -%}
|
||||||
<div class="form-group">
|
|
||||||
<{{ element|default('div') }} class="custom-file">
|
<{{ element|default('div') }} class="custom-file">
|
||||||
{%- set type = type|default('file') -%}
|
{%- set type = type|default('file') -%}
|
||||||
{{- block('form_widget_simple') -}}
|
{{- block('form_widget_simple') -}}
|
||||||
@ -125,7 +124,6 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</label>
|
</label>
|
||||||
</{{ element|default('div') }}>
|
</{{ element|default('div') }}>
|
||||||
</div>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block form_widget_simple -%}
|
{% block form_widget_simple -%}
|
||||||
|
@ -942,9 +942,6 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|||||||
|
|
||||||
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'n/a', 'attr' => array('class' => 'my&class form-control-file')),
|
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'n/a', 'attr' => array('class' => 'my&class form-control-file')),
|
||||||
'/div
|
'/div
|
||||||
[@class="form-group"]
|
|
||||||
[
|
|
||||||
./div
|
|
||||||
[@class="custom-file"]
|
[@class="custom-file"]
|
||||||
[
|
[
|
||||||
./input
|
./input
|
||||||
@ -953,7 +950,6 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|||||||
/following-sibling::label
|
/following-sibling::label
|
||||||
[@for="name"]
|
[@for="name"]
|
||||||
]
|
]
|
||||||
]
|
|
||||||
'
|
'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -964,9 +960,6 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|||||||
|
|
||||||
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'n/a', 'attr' => array('class' => 'my&class form-control-file', 'placeholder' => 'Custom Placeholder')),
|
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'n/a', 'attr' => array('class' => 'my&class form-control-file', 'placeholder' => 'Custom Placeholder')),
|
||||||
'/div
|
'/div
|
||||||
[@class="form-group"]
|
|
||||||
[
|
|
||||||
./div
|
|
||||||
[@class="custom-file"]
|
[@class="custom-file"]
|
||||||
[
|
[
|
||||||
./input
|
./input
|
||||||
@ -975,7 +968,6 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
|||||||
/following-sibling::label
|
/following-sibling::label
|
||||||
[@for="name" and text() = "[trans]Custom Placeholder[/trans]"]
|
[@for="name" and text() = "[trans]Custom Placeholder[/trans]"]
|
||||||
]
|
]
|
||||||
]
|
|
||||||
'
|
'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user