luci-base: don't treat .rmempty flag as optional for ListValue widgets
Restore the old CBI behaviour of not automatically rendering empty selection choices in ListValue select dropdowns when .rmempty is specified. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
b949c02624
commit
2d3470b700
3 changed files with 3 additions and 3 deletions
|
@ -1460,7 +1460,7 @@ var CBIListValue = CBIValue.extend({
|
|||
id: this.cbid(section_id),
|
||||
size: this.size,
|
||||
sort: this.keylist,
|
||||
optional: this.rmempty || this.optional,
|
||||
optional: this.optional,
|
||||
placeholder: this.placeholder,
|
||||
validate: L.bind(this.validate, this, section_id)
|
||||
});
|
||||
|
|
|
@ -243,7 +243,7 @@ var UISelect = UIElement.extend({
|
|||
'multiple': this.options.multiple ? '' : null
|
||||
}));
|
||||
|
||||
if (this.options.optional)
|
||||
if (this.options.optional || this.choices.hasOwnProperty(''))
|
||||
frameEl.lastChild.appendChild(E('option', {
|
||||
'value': '',
|
||||
'selected': (this.values.length == 0 || this.values[0] == '') ? '' : null
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
sort = self.keylist,
|
||||
widget = self.widget,
|
||||
datatype = self.datatype,
|
||||
optional = self.optional or self.rmempty,
|
||||
optional = self.optional,
|
||||
placeholder = self.placeholder
|
||||
}
|
||||
}))%>></div>
|
||||
|
|
Loading…
Reference in a new issue