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

This commit is contained in:
Book Pauk
2020-11-04 14:41:38 +07:00
parent d540cb91a9
commit fcf6639d38

View File

@@ -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') {