realbig / rbm-field-helpers

0 stars 1 forks source link

Select2: Default the placeholder to the option with an empty value #88

Open d4mation opened 3 years ago

d4mation commented 3 years ago

If you passed into options something like:

array(
   'options' => array( '' => 'Select an option' ) + $options,
)

It would be nice if it would populate the Select2 placeholder automatically if an option with an empty value existed. If no Select2 placeholder is provided, it will cause the field to collapse on itself which looks bad/buggy.