Commit 49d076bd authored by Tomáš Peterka's avatar Tomáš Peterka

[renderjs_ui] Select first item only when items are available

parent 714735c8
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
render_timestamp: new Date().getTime() render_timestamp: new Date().getTime()
}; };
// first_item means to select the first item by default on empty value // first_item means to select the first item by default on empty value
if (isEmpty(state_dict.value) && (state_dict.first_item)) { if (isEmpty(state_dict.value) && (state_dict.first_item) && (!isEmpty(field_json.items))) {
state_dict.value = field_json.items[0][1]; state_dict.value = field_json.items[0][1];
} }
return this.changeState(state_dict); return this.changeState(state_dict);
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>zope</string> </value> <value> <string>superkato</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.32182.25672.48110</string> </value> <value> <string>965.39086.65235.37700</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1518615992.91</float> <float>1523373335.9</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment