diff --git a/packages/runtime-core/src/apiCreateApp.ts b/packages/runtime-core/src/apiCreateApp.ts index dbf71951b16..09cac3fb8c8 100644 --- a/packages/runtime-core/src/apiCreateApp.ts +++ b/packages/runtime-core/src/apiCreateApp.ts @@ -81,6 +81,7 @@ export interface AppConfig { instance: ComponentPublicInstance | null, trace: string ) => void + skipEventsTimestampCheck: boolean /** * Options to pass to `@vue/compiler-dom`. @@ -155,7 +156,8 @@ export function createAppContext(): AppContext { optionMergeStrategies: {}, errorHandler: undefined, warnHandler: undefined, - compilerOptions: {} + compilerOptions: {}, + skipEventsTimestampCheck: false }, mixins: [], components: {}, diff --git a/packages/runtime-dom/src/modules/events.ts b/packages/runtime-dom/src/modules/events.ts index d0f8d364a29..1fed6f30ab6 100644 --- a/packages/runtime-dom/src/modules/events.ts +++ b/packages/runtime-dom/src/modules/events.ts @@ -118,7 +118,10 @@ function createInvoker( // AFTER it was attached. const timeStamp = e.timeStamp || _getNow() - if (skipTimestampCheck || timeStamp >= invoker.attached - 1) { + // Skip the timestamp check if the skipEventsTimestampCheck app config is set to true. + const appSkipTimestampCheck = instance?.appContext?.config.skipEventsTimestampCheck === true + + if (appSkipTimestampCheck || skipTimestampCheck || timeStamp >= invoker.attached - 1) { callWithAsyncErrorHandling( patchStopImmediatePropagation(e, invoker.value), instance,