Skip to content

TypeScript does not properly support the TouchEvent constructor #14435

@MadaraUchiha

Description

@MadaraUchiha

TypeScript Version: 2.2.1

Code

const event = new TouchEvent('touchstart', {ctrlKey: true});

Expected behavior:

No error. As per MDN

Actual behavior:
The TouchEvent constructor in lib.d.ts is defined to not accept parameters.


Stack Overflow question about this: How to manually trigger a Touch event in TypeScript?

Note:
I already have a PR ready for the fix, based on the same MDN article.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions