SVGHMI: Fix: on screen keyboard wasn't showing up when editing local variables through Input widget. svghmi
authorEdouard Tisserant
Wed, 25 Nov 2020 14:43:03 +0100
branchsvghmi
changeset 3075 2f9dbd3ee445
parent 3074 2ec1aebda927
child 3076 f1efd1c01991
SVGHMI: Fix: on screen keyboard wasn't showing up when editing local variables through Input widget.
svghmi/svghmi.js
--- a/svghmi/svghmi.js	Fri Nov 20 11:17:40 2020 +0100
+++ b/svghmi/svghmi.js	Wed Nov 25 14:43:03 2020 +0100
@@ -413,8 +413,11 @@
 
 var xmlns = "http://www.w3.org/2000/svg";
 var edit_callback;
+const localtypes = {"PAGE_LOCAL":null, "HMI_LOCAL":null}
 function edit_value(path, valuetype, callback, initial, size) {
-
+    if(valuetype in localtypes){
+        valuetype = (typeof initial) == "number" ? "HMI_REAL" : "HMI_STRING";
+    }
     let [keypadid, xcoord, ycoord] = keypads[valuetype];
     edit_callback = callback;
     let widget = hmi_widgets[keypadid];