Content-Length: 728 | pFad | http://github.com/testing-library/testing-library-docs/pull/262.diff
thub.com 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 }) ```Fetched URL: http://github.com/testing-library/testing-library-docs/pull/262.diff
Alternative Proxies: