Skip to content

keypress e.code is not valid TypeScript, but is valid JavaScript #9206

Closed
@ChicagoDave

Description

@ChicagoDave

TypeScript Version:

1.8.10

Code

// A self-contained demonstration of the problem follows...

Grrr - I don't have time for this

in an input element onkeypress, you can't touch e.code. You have to create a plain JS function to read that totally legitimate property on the event argument.

Expected behavior:

(e.code == "Enter") is valid

Actual behavior:

(e.code == "Enter") is not valid because .code is not recognized as a legit property

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions