From: Joseph Coffland Date: Mon, 8 Mar 2021 03:29:45 +0000 (-0800) Subject: Fixed problem with entering config values while virtual keyboard is active X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=08e56e1856e1508dc5047a3f7f93eb0cef117708;p=bbctrl-firmware Fixed problem with entering config values while virtual keyboard is active --- diff --git a/CHANGELOG.md b/CHANGELOG.md index dcc986f..e7eece2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/js/templated-input.js b/src/js/templated-input.js index d47b544..350cb79 100644 --- a/src/js/templated-input.js +++ b/src/js/templated-input.js @@ -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); diff --git a/src/py/bbctrl/Config.py b/src/py/bbctrl/Config.py index 1c8ee21..4346e65 100644 --- a/src/py/bbctrl/Config.py +++ b/src/py/bbctrl/Config.py @@ -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