Skip to content

Commit

Permalink
addEventListener won't accept SemiSyntheticEvent due to extra helper …
Browse files Browse the repository at this point in the history
…methods, so we need to mark them as optional.
  • Loading branch information
jhsware committed Dec 4, 2023
1 parent 0b5ad3d commit aaaf596
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/inferno/src/DOM/events/delegation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ function attachEventToDocument(
? rootClickEvent(name)
: rootEvent(name);

// @ts-expect-error TODO: FIXME
document.addEventListener(normalizeEventName(name), attachedEvent);

return attachedEvent;
Expand Down
4 changes: 2 additions & 2 deletions packages/inferno/src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export interface SemiSyntheticEvent<T> extends Event {
* A reference to the element on which the event listener is registered.
*/
currentTarget: EventTarget & T;
isDefaultPrevented: () => boolean;
isPropagationStopped: () => boolean;
isDefaultPrevented?: () => boolean;
isPropagationStopped?: () => boolean;
}

export type ClipboardEvent<T> = SemiSyntheticEvent<T> & NativeClipboardEvent;
Expand Down

0 comments on commit aaaf596

Please sign in to comment.