Skip to content

getEventKey implementation inconsistent with DOM3 spec / Firefox implementation #2193

Open
@Daniel15

Description

@Daniel15

There are some inconsistencies between getEventKey and the DOM3 keyboard event spec (as well as what Firefox has implemented):

  • key property is not correctly set for printable characters on keydown and keyup events. This works properly in Firefox, and my interpretation of the standard is that Firefox's behaviour is correct here. From the spec: If the key generates a printable character, and there exists an appropriate Unicode code point, then the KeyboardEvent.key attribute must be a string consisting of the char value of that character.
  • Enter key only fires keydown in Firefox, but fires both keydown and keypress in Chrome. This should be consistent across browsers
  • CapsLock key only fires keydown when it is toggled on. When caps lock is toggled from on to off, no keydown event is fired (this may be a browser limitation in Chrome)

Repro: Test this page in Firefox and compare the result to Chrome: http://jsfiddle.net/63ycmLhe/1/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions