diff --git a/src/UI/Store/CommandStore.ts b/src/UI/Store/CommandStore.ts index 8507b7a10..9a08bfa8e 100644 --- a/src/UI/Store/CommandStore.ts +++ b/src/UI/Store/CommandStore.ts @@ -27,13 +27,16 @@ export class CommandStore this.index++; } - + get InputIsFoucs(): Boolean + { + return document.activeElement.id == "command-input"; + } private RegionKeyDownEvent() { window.document.addEventListener("keydown", (e: KeyboardEvent) => { - if (document.activeElement.id != "command-input") + if (!this.InputIsFoucs) { if (IsNumble(e.keyCode) || IsChar(e.keyCode)) { @@ -49,9 +52,18 @@ export class CommandStore keyDownHandle = (keyCode: number) => { + console.log(keyCode); let inpValue: string = this.elInput.value; switch (keyCode) { + case 8: + { + if (!this.InputIsFoucs) + { + this.elInput.value = this.elInput.value.slice(0, -1) + } + break + } case 13: case 32: if (inpValue != "")