Skip to content

Commit 72bdd6b

Browse files
illrightdmtrKovalenko
authored andcommitted
fix(realType): add an escape sequence for a left brace (#547)
* fix: add an escape sequence for a left brace * chore: add an e2e test
1 parent 8a04ea8 commit 72bdd6b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cypress/e2e/type.cy.ts

+8
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,12 @@ describe("cy.realType", () => {
3030
cy.get("input[name=q]").realClick({ clickCount: 3 });
3131
cy.realPress("Backspace");
3232
});
33+
34+
it("can type braces", () => {
35+
cy.realType("{");
36+
cy.get("input[name=q]").should("have.value", "{");
37+
cy.realPress("Backspace");
38+
cy.realType("{{}test}");
39+
cy.get("input[name=q]").should("have.value", "{test}");
40+
});
3341
});

src/keyCodeDefinitions.ts

+1
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ export const keyCodeDefinitions = {
260260
'?': {'keyCode': 191, 'key': '?', 'code': 'Slash'},
261261
'~': {'keyCode': 192, 'key': '~', 'code': 'Backquote'},
262262
'{': {'keyCode': 219, 'key': '{', 'code': 'BracketLeft'},
263+
'{{}': {'keyCode': 219, 'key': '{', 'code': 'BracketLeft'},
263264
'|': {'keyCode': 220, 'key': '|', 'code': 'Backslash'},
264265
'}': {'keyCode': 221, 'key': '}', 'code': 'BracketRight'},
265266
'"': {'keyCode': 222, 'key': '"', 'code': 'Quote'}

0 commit comments

Comments
 (0)