util.dataforms: Fix including default value for list-single when given as field.value[].default

This commit is contained in:
Kim Alvefur 2016-05-29 15:57:03 +02:00
parent 7f091c5a3b
commit 6b2c577b20

View file

@ -72,7 +72,7 @@ function form_t.form(layout, data, formtype)
for _, val in ipairs(field.options or value) do
if type(val) == "table" then
form:tag("option", { label = val.label }):tag("value"):text(val.value):up():up();
if value == val.value or field.options and val.default and (not has_default) then
if value == val.value or val.default and (not has_default) then
form:tag("value"):text(val.value):up();
has_default = true;
end