Commit eb028ada authored by Tomáš Peterka's avatar Tomáš Peterka

[renderjs_ui] Select first item only when items are available

parent cd7f0fd6
......@@ -28,7 +28,7 @@
render_timestamp: new Date().getTime()
};
// 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];
}
return this.changeState(state_dict);
......
......@@ -216,7 +216,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>superkato</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.32182.25672.48110</string> </value>
<value> <string>965.39086.65235.37700</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1518615992.91</float>
<float>1523373335.9</float>
<string>UTC</string>
</tuple>
</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