flowbite-bundle icon indicating copy to clipboard operation
flowbite-bundle copied to clipboard

Dropdown styling not applied unless setting autocomplete property

Open NielDuysters opened this issue 1 year ago • 2 comments

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.

NielDuysters avatar Nov 20 '24 09:11 NielDuysters

I don't think this issue is due to the bundle. I tested it with a new project and everything works fine.

The autocomplete option come from the symfony/ux-autocomplete package ?

ker0x avatar Nov 20 '24 14:11 ker0x

Thank you for your answer. Yes that is correct, it comes from ux-autocomplete.

NielDuysters avatar Nov 20 '24 15:11 NielDuysters