Fixes: #2943
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
widget: 'select',
orientation: 'horizontal'
}, options);
+
+ if (this.choices.hasOwnProperty(''))
+ this.options.optional = true;
},
render: function() {
'multiple': this.options.multiple ? '' : null
}));
- if (this.options.optional || this.choices.hasOwnProperty(''))
+ if (this.options.optional)
frameEl.lastChild.appendChild(E('option', {
'value': '',
'selected': (this.values.length == 0 || this.values[0] == '') ? '' : null