File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export namespace JSX {
8686 } & {
8787 [ Tag in keyof SVGElementTagNameMap as Tag extends "svg"
8888 ? Tag
89- : `svg:${Tag } `] : IntrinsicElementAttributes < SVGElementTagNameMap [ Tag ] > & {
89+ : `svg:${Tag } `] : { [ key : string ] : any } & {
9090 children ?: ShadowElement ;
9191 className : string ;
9292 onplusnewerror ?: ( evt : PlusnewErrorEvent ) => void ;
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export function addEventListener(
8383 this : HTMLElement ,
8484 eventName : string ,
8585 listener : ( event : Event ) => unknown ,
86- options ?: AddEventListenerOptions ,
86+ options ?: boolean | AddEventListenerOptions ,
8787) {
8888 if ( eventListenerSymbol in this === false ) {
8989 ( this as any ) [ eventListenerSymbol ] = { } ;
@@ -93,8 +93,12 @@ export function addEventListener(
9393 }
9494
9595 const listenerOverwrite = ( evt : Event ) => {
96- if ( options ?. once === true ) {
97- this . removeEventListener ( eventName , listener ) ;
96+ if (
97+ typeof options === "object" &&
98+ options !== null &&
99+ options ?. once === true
100+ ) {
101+ ( this as any ) [ eventListenerSymbol ] ?. [ eventName ] ?. delete ( listener ) ;
98102 }
99103
100104 const result = listener ( evt ) ;
@@ -103,6 +107,7 @@ export function addEventListener(
103107 active . eventPromises . push ( result ) ;
104108 }
105109 } ;
110+
106111 ( this as any ) [ eventListenerSymbol ] [ eventName ] . set (
107112 listener ,
108113 listenerOverwrite ,
You can’t perform that action at this time.
0 commit comments