Ver código fonte

Небольшие поправки обработки клавиш

Book Pauk 4 anos atrás
pai
commit
fcf6639d38
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      client/components/share/StdDialog.vue

+ 4 - 1
client/components/share/StdDialog.vue

@@ -144,6 +144,7 @@ class StdDialog extends Vue {
         this.inputValidator = null;
         this.inputValidator = null;
         this.inputValue = '';
         this.inputValue = '';
         this.error = '';
         this.error = '';
+        this.showed = false;
 
 
         this.iconColor = 'text-warning';
         this.iconColor = 'text-warning';
         if (opts && opts.color) {
         if (opts && opts.color) {
@@ -161,6 +162,7 @@ class StdDialog extends Vue {
             this.hideTrigger();
             this.hideTrigger();
             this.hideTrigger = null;
             this.hideTrigger = null;
         }
         }
+        this.showed = false;
     }
     }
 
 
     onShow() {
     onShow() {
@@ -170,6 +172,7 @@ class StdDialog extends Vue {
                 this.validate(this.inputValue);
                 this.validate(this.inputValue);
             this.$refs.input.focus();
             this.$refs.input.focus();
         }
         }
+        this.showed = true;
     }
     }
 
 
     validate(value) {
     validate(value) {
@@ -276,7 +279,7 @@ class StdDialog extends Vue {
     }
     }
 
 
     keyHook(event) {
     keyHook(event) {
-        if (this.active) {
+        if (this.active && this.showed) {
             let handled = false;
             let handled = false;
             if (this.type == 'hotKey') {
             if (this.type == 'hotKey') {
                 if (event.type == 'keydown') {
                 if (event.type == 'keydown') {