diff --git a/docs/dom-testing-library/api-events.md b/docs/dom-testing-library/api-events.md index 736c94bba..a4bd70677 100644 --- a/docs/dom-testing-library/api-events.md +++ b/docs/dom-testing-library/api-events.md @@ -70,6 +70,10 @@ fireEvent.keyDown(domNode, { key: 'Enter', code: 13 }) // will Fire an KeyboardEvent with charCode = 0 fireEvent.keyDown(domNode, { key: 'Enter', code: 13 }) +// If using event.which, be sure to set the keyCode or it will be fallback to 0 +// will Fire a KeyboardEvent with expected which = 13 +fireEvent.keyDown(domNode, { key: 'Enter', keyCode: 13 }) + // will Fire an KeyboardEvent with charCode = 65 fireEvent.keyDown(domNode, { key: 'A', code: 65, charCode: 65 }) ```
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: