This PR fixes event detection in jsdom / happy-dom.
Current solution uses deprecated keyCode property to trigger event handlers.
Testing component by emitting keyboard event with testing-library/user-event i.e.userEvent.keyboard("{arrowdown}") does not trigger callbacks defined in onArrowPress or onEnterPress handlers.
Adding an event code as a fallback fixes the issue.
This PR fixes event detection in jsdom / happy-dom. Current solution uses deprecated keyCode property to trigger event handlers.
Testing component by emitting keyboard event with testing-library/user-event i.e.
userEvent.keyboard("{arrowdown}")
does not trigger callbacks defined inonArrowPress
oronEnterPress
handlers.Adding an event code as a fallback fixes the issue.