emberjs / emberjs/ember-test-helpers
feature request: manually fire click event when keyDown key is enter or spacebar
- Dominant language
- JavaScript
- Stars
- 188
- Forks
- 254
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.