Skip to content

<dialog/> ref prop has type of HTMLElement instead of HTMLDialogElement #1138

@toondkn

Description

@toondkn

Describe the bug

A TypeScript typing error.

The title described the issue in full.

Your Example Website or App

https://stackblitz.com/edit/vitejs-vite-qztpd4?file=src/App.tsx

Steps to Reproduce the Bug or Issue

Try consuming the element ref prop as a HTMLDialogElement. TypeScript will complain, it thinks it's an HTMLElement.

Expected behavior

ref prop is typed as HTMLDialogElement.

Screenshots or Videos

No response

Platform

TypeScript 4.7.4.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    typescriptrelating to typescript or types

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions