Skip to content

[Web API type definition issue] Node.parentElement has wrong type #2021

Open
@trusktr

Description

@trusktr

Summary

Node.parentElement has type HTMLElement | null but it should be Element | null

Expected vs. Actual Behavior

Expected: node.parentElement type to be Element | null
Actual: HTMLElement | null

Playground Link

https://www.typescriptlang.org/play/?#code/MYewdgzgLgBKZQIYEswFMBOMC8MAmIwArgLZoIB0wGaiUaAogDZpkIAUA5HsgG6cBKAFDwkqTBVToMACQAqAWQAyOGJwA8EXgHMAfOr3qA9IaNa9nISPDQY21aJTSKAM2QZozVuSgBhABbITHgAhK7unixsfoHBMIgQMADKAGoA4mle0VbwECAsFEwg2uzaFAAOiDQIWT4wqNCIYMBoIC7J6bUIAjBGRjBQGERoMDk2sNoATKplldVQXbAJHZlRPmOQ+WiFxaXTDUjNre2pq97dvf2ITHkDQ2hCQA

Browser Support

  • This API is supported in at least two major browser engines (not two Chromium-based browsers).

Have Tried The Latest Releases

  • This issue applies to the latest release of TypeScript.
  • This issue applies to the latest release of @types/web.

Additional Context

Proof: run the example in the playground.

Similar to:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions