Skip to content

Commit 039994e

Browse files
yyx990803Lostlover
authored andcommitted
fix: bail out of event blocking for iOS bug
close vuejs#9462
1 parent cd35062 commit 039994e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/platforms/web/runtime/modules/events.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,17 @@ function add (
6161
const original = handler
6262
handler = original._wrapper = function (e) {
6363
if (
64+
// no bubbling, should always fire.
65+
// this is just a safety net in case event.timeStamp is unreliable in
66+
// certain weird environments...
67+
e.target === e.currentTarget ||
68+
// event is fired after handler attachment
6469
e.timeStamp >= attachedTimestamp ||
70+
// #9462 bail for iOS 9 bug: event.timeStamp is 0 after history.pushState
71+
e.timeStamp === 0 ||
6572
// #9448 bail if event is fired in another document in a multi-page
66-
// electron/nw.js app
73+
// electron/nw.js app, since event.timeStamp will be using a different
74+
// starting reference
6775
e.target.ownerDocument !== document
6876
) {
6977
return original.apply(this, arguments)

0 commit comments

Comments
 (0)