Skip to content

Commit 90c3532

Browse files
authored
fix(runtime-dom): compatibility for cases where event.timeStamp is 0 (#1328)
close #1325
1 parent 47c4ffb commit 90c3532

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: packages/runtime-dom/src/modules/events.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ function createInvoker(
128128
// the solution is simple: we save the timestamp when a handler is attached,
129129
// and the handler would only fire if the event passed to it was fired
130130
// AFTER it was attached.
131-
if (e.timeStamp >= invoker.lastUpdated - 1) {
131+
const timeStamp = e.timeStamp || _getNow()
132+
if (timeStamp >= invoker.lastUpdated - 1) {
132133
callWithAsyncErrorHandling(
133134
patchStopImmediatePropagation(e, invoker.value),
134135
instance,

0 commit comments

Comments
 (0)