diff --git a/docs/dom-testing-library/api-events.mdx b/docs/dom-testing-library/api-events.mdx index 8801f9c24..4f7d3fe1b 100644 --- a/docs/dom-testing-library/api-events.mdx +++ b/docs/dom-testing-library/api-events.mdx @@ -96,6 +96,8 @@ fireEvent.keyDown(domNode, {key: 'Enter', code: 'Enter', charCode: 13}) fireEvent.keyDown(domNode, {key: 'A', code: 'KeyA'}) ``` +> :warning: `React` doesn't dispatch a `SyntheticEvent` for a native `keypress` event without `event.charCode === 13 || event.charCode >= 32`. +> I.e. `onKeyPress` handlers will only be called if you include an appropriate `charCode` property. You can find out which key code to use at [https://keycode.info/](https://keycode.info/).