SyntaxFix
Write A Post
Hire A Developer
Questions
This is due to a bug in Webkit.
You can work around the Webkit bug using createEvent('Event') rather than createEvent('KeyboardEvent'), and then assigning the keyCode property. See this answer and this example.
createEvent('Event')
createEvent('KeyboardEvent')
keyCode