Skip to content
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

fix: correct the type of <details>'s onToggle event handler #10938

Merged
merged 2 commits into from
May 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/runtime-dom/src/jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export interface DataHTMLAttributes extends HTMLAttributes {

export interface DetailsHTMLAttributes extends HTMLAttributes {
open?: Booleanish
onToggle?: Event
onToggle?: (payload: ToggleEvent) => void
Copy link

@frsimond frsimond May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have used the tooling in place to fix this locally on my project. Dont know if it is good practice or not.

interface DetailsHTMLEvents {
    onToggle?: ToggleEvent;
}
export interface DetailsHTMLAttributes extends HTMLAttributes, EventHandlers<DetailsHTMLEvents> {
    open?: Booleanish;
}

}

export interface DelHTMLAttributes extends HTMLAttributes {
Expand Down