Skip to content

document.createElement('dialog') should not return HTMLElement as type #26081

@Akxe

Description

@Akxe

TypeScript Version: 2.9.2, 3.0.1

Search Terms:
createElement dialog
Code

const dialog: HTMLDialogElement = document.createElement('dialog');

Expected behavior:
No error...

Actual behavior:
Type 'HTMLElement' is not assignable to type 'HTMLDialogElement'.

Playground Link:
http://www.typescriptlang.org/play/#src=const%20dialog%3A%20HTMLDialogElement%20%3D%20document.createElement('dialog')%3B

Related Issues:
Few about adding dialog element definition.

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