Skip to content

Commit

Permalink
fix: bail out of event blocking for iOS bug
Browse files Browse the repository at this point in the history
close #9462
  • Loading branch information
yyx990803 committed Feb 9, 2019
1 parent c198950 commit 0bad7e2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/platforms/web/runtime/modules/events.js
Expand Up @@ -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 ||

This comment has been minimized.

Copy link
@ericdrobinson

ericdrobinson Aug 7, 2019

@yyx990803 Can you please explain what this is supposed to do? I'm working in an environment (Adobe CEP-based panels) where this appears to cause button functionality to break. Specifically, it occurs on buttons with images in them. When debugging the e.target is, for example, an svg whereas the e.currentTarget is a particular div. This presents as the following problem:

  1. Clicking on the button icon: No effect.
  2. Clicking on the button, next to the icon: Specified callback is triggered as expected.

The buttons begin to work if the user right-clicks anywhere. This is likely a bug on Adobe's (or the NW.js) side.

This comment has been minimized.

Copy link
@ericdrobinson

ericdrobinson Aug 7, 2019

To be clear, the Adobe CEP environment is effectively a custom NW.js integration. See this documentation for more (specifically the CEP 9.0 column of the linked table).

This comment has been minimized.

Copy link
@LinusBorg

LinusBorg Aug 7, 2019

Member

You will almost surely not get a reply on this comment once it's slipped down in his notifications (which likely takes only a few minutes or hours.

If you seem to have come across a bug caused by this, the appropriate and more promising way to handle it would be to open an issue about it.

This comment has been minimized.

Copy link
@ericdrobinson

ericdrobinson Aug 7, 2019

@LinusBorg Thanks very much for the heads up!

I did a bit more research on this and opened up issue #10366. Hopefully we'll be able to figure something out here. Wasn't an issue in 2.5.x. Hopefully we'll be able to determine a fix for 2.6.x+...

// 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)
Expand Down

0 comments on commit 0bad7e2

Please sign in to comment.