svghmi/widget_keypad.ysl2
branchsvghmi
changeset 3042 ed43facc7137
parent 3033 52f6548982d4
child 3047 c113904f0e62
equal deleted inserted replaced
3041:de4503de2f8c 3042:ed43facc7137
    87              end_modal.call(this);
    87              end_modal.call(this);
    88          }
    88          }
    89 
    89 
    90          on_Enter_click() {
    90          on_Enter_click() {
    91              let coercedval = (typeof this.initial) == "number" ? Number(this.editstr) : this.editstr;
    91              let coercedval = (typeof this.initial) == "number" ? Number(this.editstr) : this.editstr;
    92              if(isNaN(coercedval)){
    92              if(typeof coercedval == 'number' && isNaN(coercedval)){
       
    93                  // revert to initial so it explicitely shows input was ignored
    93                  this.editstr = String(this.initial);
    94                  this.editstr = String(this.initial);
    94                  this.update();
    95                  this.update();
    95              } else { // revert to initial so it explicitely shows input was ignored
    96              } else { 
    96                  let callback_obj = this.result_callback_obj;
    97                  let callback_obj = this.result_callback_obj;
    97                  end_modal.call(this);
    98                  end_modal.call(this);
    98                  callback_obj.edit_callback(coercedval);
    99                  callback_obj.edit_callback(coercedval);
    99              }
   100              }
   100          }
   101          }