emberjs / emberjs/ember-test-helpers

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

Open
#1,054 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.