Skip to content

Commit

Permalink
fix(realType): add an escape sequence for a left brace (#547)
Browse files Browse the repository at this point in the history
* fix: add an escape sequence for a left brace

* chore: add an e2e test
  • Loading branch information
illright authored and dmtrKovalenko committed Aug 28, 2023
1 parent 8a04ea8 commit 72bdd6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cypress/e2e/type.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@ describe("cy.realType", () => {
cy.get("input[name=q]").realClick({ clickCount: 3 });
cy.realPress("Backspace");
});

it("can type braces", () => {
cy.realType("{");
cy.get("input[name=q]").should("have.value", "{");
cy.realPress("Backspace");
cy.realType("{{}test}");
cy.get("input[name=q]").should("have.value", "{test}");
});
});
1 change: 1 addition & 0 deletions src/keyCodeDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export const keyCodeDefinitions = {
'?': {'keyCode': 191, 'key': '?', 'code': 'Slash'},
'~': {'keyCode': 192, 'key': '~', 'code': 'Backquote'},
'{': {'keyCode': 219, 'key': '{', 'code': 'BracketLeft'},
'{{}': {'keyCode': 219, 'key': '{', 'code': 'BracketLeft'},
'|': {'keyCode': 220, 'key': '|', 'code': 'Backslash'},
'}': {'keyCode': 221, 'key': '}', 'code': 'BracketRight'},
'"': {'keyCode': 222, 'key': '"', 'code': 'Quote'}
Expand Down

0 comments on commit 72bdd6b

Please sign in to comment.