SVGHMI: Fix bug in keypad leading to error messages in browser console when keypas has no Shift or CapsLock keys svghmi
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Tue, 29 Dec 2020 15:39:48 +0100
branchsvghmi
changeset 3102 abb487b56911
parent 3101 4cbf024a6640
child 3103 677764fba71d
SVGHMI: Fix bug in keypad leading to error messages in browser console when keypas has no Shift or CapsLock keys
svghmi/widget_keypad.ysl2
--- a/svghmi/widget_keypad.ysl2	Tue Dec 29 15:38:31 2020 +0100
+++ b/svghmi/widget_keypad.ysl2	Tue Dec 29 15:39:48 2020 +0100
@@ -175,11 +175,11 @@
                  this._editstr = this.editstr;
                  this.Value_elt.textContent = this.editstr;
              }
-             if(this.shift != this._shift){
+             if(this.Shift_sub && this.shift != this._shift){
                  this._shift = this.shift;
                  (this.shift?widget_active_activable:widget_inactive_activable)(this.Shift_sub);
              }
-             if(this.caps != this._caps){
+             if(this.CapsLock_sub && this.caps != this._caps){
                  this._caps = this.caps;
                  (this.caps?widget_active_activable:widget_inactive_activable)(this.CapsLock_sub);
              }