Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Akxe opened this issue Jul 31, 2018 · 2 comments
Closed

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

Akxe opened this issue Jul 31, 2018 · 2 comments
Assignees
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@Akxe
Copy link

Akxe commented Jul 31, 2018

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.

@mhegazy mhegazy added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this labels Jul 31, 2018
@mhegazy mhegazy added this to the Community milestone Jul 31, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Jul 31, 2018

PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes.

@AbhiPrasad
Copy link

First time peeking around lib files, figured I would give it a hand. Opened up a PR to fix this (linked above)!

@mhegazy mhegazy modified the milestones: Community, TypeScript 3.1 Aug 2, 2018
@mhegazy mhegazy self-assigned this Aug 2, 2018
@mhegazy mhegazy added the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Aug 2, 2018
@mhegazy mhegazy reopened this Aug 2, 2018
@mhegazy mhegazy added Domain: Quick Fixes Editor-provided fixes, often called code actions. Fixed A PR has been merged for this issue and removed Domain: Quick Fixes Editor-provided fixes, often called code actions. labels Aug 2, 2018
@mhegazy mhegazy removed the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants