Fixed problem with entering config values while virtual keyboard is active
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Mon, 8 Mar 2021 03:29:45 +0000 (19:29 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Mon, 8 Mar 2021 03:29:45 +0000 (19:29 -0800)
CHANGELOG.md
src/js/templated-input.js
src/py/bbctrl/Config.py

index dcc986fbf61ee2dda214655c5680acdf4e258502..e7eece2bafface1055199542cf98c877d2178b4b 100644 (file)
@@ -13,8 +13,9 @@ Buildbotics CNC Controller Firmware Changelog
  - Added macro buttons.
  - Fixed error setting lower soft limit with virtual keyboard installed. #249
  - Fix numerical overflow causing long (time) linear moves to fail. #258
- - Better gamepad handling
- - Fixed problem with web layout while using virtual keyboard
+ - Better gamepad handling.
+ - Fixed problem with web layout while using virtual keyboard.
+ - Fixed problem with entering config values while virtual keyboard is active.
 
 ## v0.4.16
  - Improved axis under/over warning tooltip.
index d47b544da1cdb9554a3c6b94b2b7b6b8920cd958..350cb790c7fee8180ee27b2c3df6a8f4c995aceb 100644 (file)
@@ -42,7 +42,7 @@ module.exports = {
 
 
     _view: function () {
-      if (this.template.scale) {
+      if (this.template.scale && !isNaN(this.model)) {
         if (this.metric) return 1 * this.model.toFixed(3);
 
         return 1 * (this.model / this.template.scale).toFixed(4);
index 1c8ee21c6a0fdeb1a88241c6d79311885e1c9e04..4346e65f5a722f88a775ad1145d74a13519592e3 100644 (file)
@@ -202,7 +202,10 @@ class Config(object):
             return
 
         # Handle defaults
-        if config is not None: value = config
+        if config is not None:
+            if self._valid_value(tmpl, config): value = config
+            else: value = tmpl['default']
+
         elif with_defaults: value = tmpl['default']
         else: return