diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig
index 8f790fdd19450..5030264c127bb 100644
--- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig
+++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig
@@ -115,17 +115,15 @@
{%- endblock percent_widget %}
{% block file_widget -%}
-
- <{{ element|default('div') }} class="custom-file">
- {%- set type = type|default('file') -%}
- {{- block('form_widget_simple') -}}
-
- {{ element|default('div') }}>
-
+ <{{ element|default('div') }} class="custom-file">
+ {%- set type = type|default('file') -%}
+ {{- block('form_widget_simple') -}}
+
+ {{ element|default('div') }}>
{% endblock %}
{% block form_widget_simple -%}
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php
index 1336405bdd30e..5710a2d486c00 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php
@@ -942,17 +942,13 @@ public function testFile()
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'n/a', 'attr' => array('class' => 'my&class form-control-file')),
'/div
- [@class="form-group"]
+ [@class="custom-file"]
[
- ./div
- [@class="custom-file"]
- [
- ./input
- [@type="file"]
- [@name="name"]
- /following-sibling::label
- [@for="name"]
- ]
+ ./input
+ [@type="file"]
+ [@name="name"]
+ /following-sibling::label
+ [@for="name"]
]
'
);
@@ -964,17 +960,13 @@ public function testFileWithPlaceholder()
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'n/a', 'attr' => array('class' => 'my&class form-control-file', 'placeholder' => 'Custom Placeholder')),
'/div
- [@class="form-group"]
+ [@class="custom-file"]
[
- ./div
- [@class="custom-file"]
- [
- ./input
- [@type="file"]
- [@name="name"]
- /following-sibling::label
- [@for="name" and text() = "[trans]Custom Placeholder[/trans]"]
- ]
+ ./input
+ [@type="file"]
+ [@name="name"]
+ /following-sibling::label
+ [@for="name" and text() = "[trans]Custom Placeholder[/trans]"]
]
'
);