--- a/svghmi/widget_keypad.ysl2 Wed Aug 26 14:27:54 2020 +0200
+++ b/svghmi/widget_keypad.ysl2 Thu Aug 27 09:59:35 2020 +0200
@@ -89,10 +89,11 @@
on_Enter_click() {
let coercedval = (typeof this.initial) == "number" ? Number(this.editstr) : this.editstr;
- if(isNaN(coercedval)){
+ if(typeof coercedval == 'number' && isNaN(coercedval)){
+ // revert to initial so it explicitely shows input was ignored
this.editstr = String(this.initial);
this.update();
- } else { // revert to initial so it explicitely shows input was ignored
+ } else {
let callback_obj = this.result_callback_obj;
end_modal.call(this);
callback_obj.edit_callback(coercedval);