Skip to content

Outdated WHATWG DOM Event interface and init #17974

@KamiQuasi

Description

@KamiQuasi

TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)

Code

// A *self-contained* demonstration of the problem follows...
// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.
document.dispatchEvent(new CustomEvent('test-event', { detail: { foo: 'bar' }, bubbles: true, composed: true }));

Expected behavior:
Utilizing the 'composed' property should work. As per the WHATWG Living Standard the 'scoped' and 'deepPath' properties of an Event have been replaced with 'composed' and 'composedPath' respectively (see https://dom.spec.whatwg.org/)

Actual behavior:
Argument of type '{ detail: { term: string; }; bubbles: true; composed: boolean; }' is not assignable to parameter of type 'CustomEventInit'.
Object literal may only specify known properties, and 'composed' does not exist in type 'CustomEventInit'.

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

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions