Diff

util/dataforms.lua @ 7446:0db72fac2faa

util.dataforms: Fix including default value for list-single when given as field.value[].default
author Kim Alvefur <zash@zash.se>
date Sun, 29 May 2016 15:57:03 +0200
parent 7442:156c95bfed0b
child 8255:d70d4c1ac17a
line wrap: on
line diff
--- a/util/dataforms.lua	Sat May 28 13:10:40 2016 +0200
+++ b/util/dataforms.lua	Sun May 29 15:57:03 2016 +0200
@@ -72,7 +72,7 @@
 				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