I have a product attribute dropdown select box that I populate via a source model.

The population works fine, but I want the first option in the list to be "Select one...". I've used the following code:

$options[] = array(
  'label' => 'Select one...',
  'value' => '',

But the result is as follows:

Duplicated empty item in select attribute

With the rendered HTML:

  <option value="">Select one...</option>
  <option data-title="Select one..." value="">Select one...</option>

What am I doing wrong?

3 Answers 3


@awarche's answer works:

You'll need to add a caption to your UI component field config:

<item name="caption" xsi:type="string" translate="true">Select one...</item>

I don't think an empty "Please select..." value belongs in a source model.


So not sure how to do this with a label but if you just want a empty select you need to follow the core example and use an empty string:


 * @param array $options
 * @return array
private function addEmptyOption(array $options)
    array_unshift($options, ['label' => $this->getAttribute()->getIsRequired() ? '' : ' ', 'value' => '']);
    return $options;

i.e 'label' => ' ',


It works with label ' ' and value ''.

Maybe the select field component has some restrictions or rather a bug.

  • 1
    The right way is to add caption to the select component <item name="caption" xsi:type="string" translate="true">Select one...</item>
    – awarche
    Oct 2, 2017 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.