diff --git a/src/UI/Components/Command.tsx b/src/UI/Components/Command.tsx index 6ad82733e..a2a3b75ec 100644 --- a/src/UI/Components/Command.tsx +++ b/src/UI/Components/Command.tsx @@ -53,6 +53,13 @@ export class CommandComponent extends React.Component<{ commandStore: CommandSto ref={o => { this.inputEl = o }} placeholder="(请输入命令:)" onKeyDown={this.inputKeyDown} + onChange={(e: React.FormEvent) => + { + if (e.currentTarget.value == " ") + { + e.currentTarget.value = "" + } + }} /> @@ -62,21 +69,26 @@ export class CommandComponent extends React.Component<{ commandStore: CommandSto inputKeyDown = (e: React.KeyboardEvent) => { - console.log(this.inputEl); - console.log(this.inputEl.value === ""); + let inpValue: string = this.inputEl.value; switch (e.keyCode) { case 13: case 32: - this.props.commandStore.commands.push(this.inputEl.value) - this.inputEl.value = "" + if (inpValue != "") + { + this.props.commandStore.commands.push(inpValue) + inpValue = "" + } break; case 27: - this.inputEl.value = "" - this.props.commandStore.commands.push("取消.") + if (inpValue != "") + { + inpValue = "" + this.props.commandStore.commands.push("取消.") + } default: break; } - console.log(e.keyCode); + // console.log(e.keyCode); } } \ No newline at end of file diff --git a/src/UI/Css/style.less b/src/UI/Css/style.less index a4f30d454..fcb339889 100644 --- a/src/UI/Css/style.less +++ b/src/UI/Css/style.less @@ -175,7 +175,7 @@ html, body { } .scroll::-webkit-scrollbar { - width: 4px; + width: 15px; } .scroll::-webkit-scrollbar-track {