diff --git a/packages/runtime-dom/src/modules/events.ts b/packages/runtime-dom/src/modules/events.ts index f146a3f8..553816c9 100644 --- a/packages/runtime-dom/src/modules/events.ts +++ b/packages/runtime-dom/src/modules/events.ts @@ -7,7 +7,7 @@ import { ErrorCodes } from 'packages/runtime-core/src/errorHandling' interface Invoker extends EventListener { value: EventValue - lastUpdated: number + attached: number } type EventValue = (Function | Function[]) & { @@ -103,7 +103,6 @@ export function patchEvent( ;(prevValue as EventValue).invoker = null invoker.value = value nextValue.invoker = invoker - invoker.lastUpdated = getNow() } else { addEventListener( el, @@ -129,7 +128,7 @@ function createInvoker( // and the handler would only fire if the event passed to it was fired // AFTER it was attached. const timeStamp = e.timeStamp || _getNow() - if (timeStamp >= invoker.lastUpdated - 1) { + if (timeStamp >= invoker.attached - 1) { callWithAsyncErrorHandling( patchStopImmediatePropagation(e, invoker.value), instance, @@ -140,7 +139,7 @@ function createInvoker( } invoker.value = initialValue initialValue.invoker = invoker - invoker.lastUpdated = getNow() + invoker.attached = getNow() return invoker }