Skip to content

Commit

Permalink
fix(runtime-dom): compatibility for cases where event.timeStamp is 0 (#…
Browse files Browse the repository at this point in the history
…1328)

close #1325
  • Loading branch information
aneryu authored Jun 12, 2020
1 parent 47c4ffb commit 90c3532
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/runtime-dom/src/modules/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ function createInvoker(
// the solution is simple: we save the timestamp when a handler is attached,
// and the handler would only fire if the event passed to it was fired
// AFTER it was attached.
if (e.timeStamp >= invoker.lastUpdated - 1) {
const timeStamp = e.timeStamp || _getNow()
if (timeStamp >= invoker.lastUpdated - 1) {
callWithAsyncErrorHandling(
patchStopImmediatePropagation(e, invoker.value),
instance,
Expand Down

0 comments on commit 90c3532

Please sign in to comment.