You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I think the type of oncancel is incorrect. For example on a HTMLDialogElement this resolves to EventHandler<HTMLElement,HTMLElement>. I think oncancel (and probably every other handler referencing EventHandler<T>) should be typed: oncancel?: EventHandler<Event,T>;
Type '(ev: Event) => void' is not assignable to type 'EventHandler<HTMLElement, HTMLElement>'.
Types of parameters 'ev' and 'event' are incompatible.
Type 'HTMLElement & { currentTarget: EventTarget & HTMLElement; }' is missing the following properties from type 'Event': bubbles, cancelBubble, cancelable, composed, and 17 more.ts(2322)
Expected behavior
In this concrete example, I think the type should be EventHandler<Event, HTMLDialogElement>. Or EventHandler<Event, HTMLElement> if there is a reason to not type it as HTMLDialogElement that escapes me right now. (iow: why is dialog not a HTMLProps<HTMLDialogElement>)
The text was updated successfully, but these errors were encountered:
Describe the bug
I think the type of oncancel is incorrect. For example on a
HTMLDialogElement
this resolves toEventHandler<HTMLElement,HTMLElement>
. I thinkoncancel
(and probably every other handler referencingEventHandler<T>
) should be typed:oncancel?: EventHandler<Event,T>;
To Reproduce
This type errors like this:
According to MDN, this should be a legal handler.
Expected behavior
In this concrete example, I think the type should be
EventHandler<Event, HTMLDialogElement>
. OrEventHandler<Event, HTMLElement>
if there is a reason to not type it as HTMLDialogElement that escapes me right now. (iow: why is dialog not aHTMLProps<HTMLDialogElement>
)The text was updated successfully, but these errors were encountered: