genemu / GenemuFormBundle

Extra Form : Captcha GD, Tinymce, Recaptcha, JQueryDate, JQueryAutocomplete, JQuerySlider, JQueryFile, JQueryImage
587 stars 265 forks source link

placeholder text for select2 inconsistency #385

Open briancappello opened 9 years ago

briancappello commented 9 years ago

Getting select2 to use the placeholder text varies depending upon options passed into the form builder.

A "standard" config works like expected:

array(
    'empty_value' => 'Select a choice...',
    'choices' => array(...),
);

However, if the preferred_choices option is passed in, then this config is required:

array(
    'empty_value' => '',
    'attr' => array(
        'data-placeholder' => 'Select a choice...',
    ),
    'preferred_choices' => array(...),
    'choices' => array(...),
);