diff --git a/src/common/Input.ts b/src/common/Input.ts index 03d02a5768e68..1e2794b8a1c46 100644 --- a/src/common/Input.ts +++ b/src/common/Input.ts @@ -209,7 +209,7 @@ export class Keyboard { } private charIsKey(char: string): char is KeyInput { - return !!keyDefinitions[char]; + return !!keyDefinitions[char as KeyInput]; } /** @@ -235,7 +235,7 @@ export class Keyboard { * Defaults to 0. */ async type(text: string, options: { delay?: number } = {}): Promise { - const delay = options.delay || null; + const delay = options.delay || undefined; for (const char of text) { if (this.charIsKey(char)) { await this.press(char, { delay });