Skip to content

Commit 355f62b

Browse files
committed
clarify behavior of keypress/input events
1 parent 72f1917 commit 355f62b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/api/commands/press.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,20 @@ componentSpecific: false
1212

1313
Trigger native key events in your application to simulate keyboard interactions.
1414

15-
A `keydown`, `press`, and `keyup` event will be dispatched directly to the browser window.
15+
A `keydown` and `keyup` event will be dispatched directly to the browser window.
1616

1717
Unlike `cy.type()`, which is best for typing multiple character keys, `cy.press()` will dispatch real keyboard events rather than simulated ones. This command is especially useful when testing focus management and keyboard navigation patterns which are critical for [accessibility testing](/app/guides/accessibility-testing) and great keyboard UX.
1818

19+
:::info
20+
21+
<strong>Behavior divergence for `input`, `keypress` events</strong>
22+
23+
In Firefox, the deprecated `keypress` event will be dispatched between the `keydown and `keyup` events. As well, if an input changes due to these events, the proper `input` event will be dispatched.
24+
25+
In Chromium, neither the `keypress` nor `input` events will be dispatched.
26+
27+
:::
28+
1929
:::caution
2030

2131
<strong>Supported Browsers:</strong>

0 commit comments

Comments
 (0)