Skip to content

bootstrap_3_layout.html.twig with inline-form has no spacing #25831

@flaushi

Description

@flaushi
Q A
Bug report? yes
Symfony version 3.4

Hi,
I am using the bootstrap_3_layout.html.twig and configure the following form:

$data = [
            'startDate' => new DateTime('2017-10-01'),
            'endDate' => new DateTime('2017-12-31'),
            'reportDate' => new DateTime()];        
        
        $builder = $this->createFormBuilder($data, ['attr' => ['class' => 'form-inline']]);
        $builder
            ->add('startDate', DateType::class, [
                'label' => 'Von: ', 
                'html5' => true, 
                'widget' => 'single_text'])
            ->add('endDate', DateType::class, [
                'label' => 'Bis: ', 
                'html5' => true, 
                'widget' => 'single_text'])
            ->add('reportDate', DateType::class, [
                'label' => 'Berichtsdatum: ', 
                'html5' => true, 
                'widget' => 'single_text'])
            ->add('save', SubmitType::class, array('label' => 'Aktualisieren', 'attr' => ['class'=> 'btn-success']));

as result, I see the following:
image
So, there is no space between the form elements.

The created html looks fine, however, I have read here that maybe a only a space/newline is missing?

This Fiddle shows my created html code. If you just click on "Tidy" the newlines are created and the spaces appear.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions