动态输入时,已经有输入的情况下,esc直接Cancel,点击画布也将结束输入.

pull/109/head
ChenX 6 years ago
parent e3b565c469
commit 308eeb313b

@ -30,6 +30,7 @@ export class DynamicInputManage
this.container.style.height = "100%"; this.container.style.height = "100%";
this.container.style.left = "0px"; this.container.style.left = "0px";
this.container.style.top = "0px"; this.container.style.top = "0px";
this.container.addEventListener("mousedown", () => { this.IsInputing = false });
document.body.appendChild(this.container); document.body.appendChild(this.container);
@ -120,13 +121,13 @@ export class DynamicInputManage
case KeyBoard.Escape: case KeyBoard.Escape:
if (this.IsInputing) if (this.IsInputing)
{ {
this.IsInputing = false; // this.IsInputing = false;
e.preventDefault(); // e.preventDefault();
e.stopPropagation(); // e.stopPropagation();
let dyn = this.inputCollection[this.focusIndex]; // let dyn = this.inputCollection[this.focusIndex];
if (dyn) // if (dyn)
dyn.Focus(); // dyn.Focus();
} }
break; break;
case KeyBoard.Tab: case KeyBoard.Tab:

Loading…
Cancel
Save