Skip to content

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

@hmajoros

Description

@hmajoros

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions