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 8f790fdd19..5030264c12 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') }} class="custom-file"> + {%- set type = type|default('file') -%} + {{- block('form_widget_simple') -}} + + {% 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 1336405bdd..5710a2d486 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap4LayoutTest.php @@ -942,17 +942,13 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest $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 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest $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]"] ] ' );