summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi
diff options
context:
space:
mode:
Diffstat (limited to 'libs/cbi')
-rw-r--r--libs/cbi/luasrc/cbi.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index 42b58ce0b..178c46f03 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -579,11 +579,6 @@ function AbstractValue.render(self, s, scope)
if not self.optional or self:cfgvalue(s) or self:formcreated(s) then
scope = scope or {}
scope.section = s
-
- -- fixup size for MultiValue fields
- if instanceof(self, MultiValue) and self.widget == "select" and not self.size then
- self.size = #self.vallist
- end
Node.render(self, scope)
end
@@ -741,6 +736,14 @@ function MultiValue.__init__(self, ...)
self.delimiter = " "
end
+function MultiValue.render(self, ...)
+ if self.widget == "select" and not self.size then
+ self.size = #self.vallist
+ end
+
+ AbstractValue.render(self, ...)
+end
+
function MultiValue.value(self, key, val)
val = val or key
table.insert(self.keylist, tostring(key))