forked from tools/josh
1
0
Fork 0
This commit is contained in:
Florine W. Dekker 2019-11-03 17:42:36 +01:00
parent 01f391d046
commit 9ba8914b85
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
1 changed files with 3 additions and 1 deletions

View File

@ -259,8 +259,10 @@ export class Terminal {
private onkeypress(event: KeyboardEvent): void {
this.scroll = 0;
// If user types anywhere, move caret to end of input, unless user was already focused on input
if (this.input !== document.activeElement)
if (this.input !== document.activeElement) {
this.inputText += event.key; // Append to input because event was not executed on input
setTimeout(() => moveCaretToEndOf(this.input), 0);
}
switch (event.key.toLowerCase()) {
case "enter":