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)