From 0bad7e2a3508b55abaa8aec2a1bd9c1127305cb4 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 9 Feb 2019 01:16:41 -0500 Subject: [PATCH] fix: bail out of event blocking for iOS bug close #9462 --- src/platforms/web/runtime/modules/events.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/platforms/web/runtime/modules/events.js b/src/platforms/web/runtime/modules/events.js index d030f55d..e5532258 100644 --- a/src/platforms/web/runtime/modules/events.js +++ b/src/platforms/web/runtime/modules/events.js @@ -61,9 +61,17 @@ function add ( const original = handler handler = original._wrapper = function (e) { if ( + // no bubbling, should always fire. + // this is just a safety net in case event.timeStamp is unreliable in + // certain weird environments... + e.target === e.currentTarget || + // event is fired after handler attachment e.timeStamp >= attachedTimestamp || + // #9462 bail for iOS 9 bug: event.timeStamp is 0 after history.pushState + e.timeStamp === 0 || // #9448 bail if event is fired in another document in a multi-page - // electron/nw.js app + // electron/nw.js app, since event.timeStamp will be using a different + // starting reference e.target.ownerDocument !== document ) { return original.apply(this, arguments)