Skip to content

keydown does not specify whether modifier keys should be indicated on dispatched click event #406

@Psychpsyo

Description

@Psychpsyo

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

If the key is the Enter or Space 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.

This happens in all browsers.1,2

The problem is that Firefox does not set the ctrlKey and shiftKey attributes on the dispatched click event. Webkit and Chrome1 do. I think it makes sense for them to get set, though the spec should probably make that explicit.

Also all the other modifier key attributes that apply to both keydown and click events. (might be worth checking whatever Webkit/Chrome do for a list.)

1 Chrome does not dispatch the click event if Ctrl is being held down.
2 I did not check for the DOMActivate event, as I am only interested in the click event.

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