Commit b0d8a7ed authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Change the state value in place

This will prevent the input gadget to be changed if its parent call render with the same value (as ERP5 does in case of formulator error).
parent 696602e1
...@@ -107,6 +107,11 @@ ...@@ -107,6 +107,11 @@
if (this.state.editable) { if (this.state.editable) {
result[select.getAttribute('name')] = result[select.getAttribute('name')] =
select.options[select.selectedIndex].value; select.options[select.selectedIndex].value;
// Change the value state in place
// This will prevent the gadget to be changed if
// its parent call render with the same value
// (as ERP5 does in case of formulator error)
this.state.value = result[select.getAttribute('name')];
} }
return result; return result;
}) })
......
...@@ -97,6 +97,12 @@ ...@@ -97,6 +97,12 @@
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>subject</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Gadget HTML5 Select JS</string> </value> <value> <string>Gadget HTML5 Select JS</string> </value>
...@@ -230,7 +236,7 @@ ...@@ -230,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>956.58742.58866.48708</string> </value> <value> <string>963.62584.36941.22510</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +254,7 @@ ...@@ -248,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1490622780.06</float> <float>1516785191.79</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