Skip to content

Dropdown styling not applied unless setting autocomplete property #32

@NielDuysters

Description

@NielDuysters

I am experiencing weird behavior when making dropdowns. First of all, the styling is only applied when the autocomplete property is defined, when selecting a value from the dropdown, the whole input-field suddenly disappears.

Recreate:
Make a Formtype with a choicetype.

        $builder = new DynamicFormBuilder($builder);
        $builder
            ->add('yesOrNo', ChoiceType::class, [
                'choices' => [
                    'yes' => true,
                    'no' => false,
                ],
                'placeholder' => 'Select option',
                'label' => 'Yes or no?',
                'constraints' => [
                    new NotNull()
                ],
            ])

The expected behavior is that styling would be applied, it is not.

        $builder = new DynamicFormBuilder($builder);
        $builder
            ->add('yesOrNo', ChoiceType::class, [
                'choices' => [
                    'yes' => true,
                    'no' => false,
                ],
                'placeholder' => 'Select option',
                'label' => 'Yes or no?',
                'autocomplete'  = 'off',    // doesn't matter if on/off
                'constraints' => [
                    new NotNull()
                ],
            ])

Now the styling is applied as expected, but when selecting an option from the dropdown, the whole input-field disappears.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions