bug #28115 [Form] Remove extra .form-group wrapper around file widget in bootstrap 4 (MrMitch)
This PR was merged into the 4.1 branch.
Discussion
----------
[Form] Remove extra .form-group wrapper around file widget in bootstrap 4
| Q | A
| ------------- | ---
| Branch? | 4.1
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
This is a follow-up to https://github.com/symfony/symfony/pull/27958 and https://github.com/symfony/symfony/pull/27919 by @apfelbox .
It fixes an extra space between the help text of a FileType widget and the widget itself. The extra space was caused by a `.form-group` wrapper in the `file_widget` block.
Commits
-------
01e7fe4fb0
[Form] Remove extra .form-group wrapper around file widget in bootstrap 4
This commit is contained in:
commit
3e47827c98
@ -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