I recently stumbled upon an issue when trying to trigger keyboard events on an element and thought I did share how I managed to get it to work.
It seems you’ll need to add a tabindex attribute to the element if you want a keyboard event to be triggered according to this article. The element also needs the focus event activated on it for this technique to work.