Any element can receive keydown events if it has a tabindex. However, the cypress type command only works on input text elements and textareas. In order to fire keydown events on arbitrary elements, for example if we want to test keyboard shortcuts in an app, we have to manually create a KeyboardEvent and call dispatchEvent on the element. While this is a viable workaround, a solution in cypress would be preferred.
Any element can receive keydown events if it has a tabindex. However, the cypress type command only works on input text elements and textareas. In order to fire keydown events on arbitrary elements, for example if we want to test keyboard shortcuts in an app, we have to manually create a KeyboardEvent and call dispatchEvent on the element. While this is a viable workaround, a solution in cypress would be preferred.