Skip to content

Commit 2dd5295

Browse files
author
Simon he
committed
fix: rawEvent cause Error
1 parent 11a05f0 commit 2dd5295

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/addEventListener.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ export function addEventListener(target: Window | Document | Element | string, e
4646
const originCall = (target as unknown as any)?.[eventName]
4747
const eventFunction = (e: Event) => {
4848
try {
49-
if (originCall)
49+
const isRawClick = originCall && originCall.toString() === 'function click() { [native code] }'
50+
if (!isRawClick && originCall)
5051
originCall?.()
5152
}
5253
catch (error) {

0 commit comments

Comments
 (0)