ember-test-helpers icon indicating copy to clipboard operation
ember-test-helpers copied to clipboard

feature request: manually fire click event when keyDown key is enter or spacebar

Open hmajoros opened this issue 3 years ago • 0 comments

per the w3c spec, when a focused element receives a keyDown event with the key Enter or , browsers will construct a native click event on that focused element.

from https://w3c.github.io/uievents/#event-type-keydown:

If the key is the Enter or key and the current focus is on a state-changing element, the default action MUST be to dispatch a click event, and a DOMActivate event if that event type is supported by the user agent (refer to § 3.5 Activation triggers and behavior for more details)

this issue is to request that ember-test-helpers follows the same pattern by modifying the triggerKeyEvent helper to also fire a click event in the cases described above.

hmajoros avatar Jun 21 '21 13:06 hmajoros