Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge not sending pointercancel #645

Open
jonathanolson opened this issue Jul 8, 2017 · 5 comments
Open

Edge not sending pointercancel #645

jonathanolson opened this issue Jul 8, 2017 · 5 comments

Comments

@jonathanolson
Copy link
Contributor

Noticed in testing for #619 where the pointer cancel seems to not happen as expected, however the general problem is larger in scope (thus this issue).

How to reproduce:

  1. Open Build an Atom in Edge, and open up something in another tab.
  2. On the first screen, start dragging around a particle with finger A.
  3. Use finger B to switch to the other browser tab (may require one or two presses).
  4. Release finger A.
  5. Go back to the simulation tab.

Expected (e.g. Chrome): pointercancel event fires, which means the particle animates back to the bucket (or to the atom if it's close to the center, because we don't handle the cancel differently yet).

Actual with Edge: Particle is now stuck in that location.

It's also possible to reproduce by:

  • In the LoL harness by having fingers B,C,D,E outside the sim (in the LoL area) trigger a zoom while finger A is dragging a particle.
  • In the LoL harness, pause and to a "long press"/"press and hold" behavior that @phet-steele originally reproduced with. This is a Windows option that triggers a right click, but doesn't seem to do the cancel.

@phet-steele, can you verify that this isn't just happening only on my Surface device?

In general, in 5 hours of debugging, I have never triggered a pointercancel event on Edge. Certain threads note that preventDefault(), touch-action, setPointerCapture, etc. could be related (w3c/pointerevents#205 (comment)). I've tried out all combinations of these, but still not getting a pointercancel. Enabling certain combinations of things also allows certain default browser behaviors to happen that we don't want to happen.

An independent code sample (https://patrickhlauke.github.io/touch/) also shows the "no pointercancel event" when doing the "switch to another tab".

If this was just the LoL prototype, I'd have bailed, but I'm concerned that switching tabs may be a somewhat common case on Edge. I'm really finding no information specific to this type of bug online, so creating a minimal reproducible example and (a) finding a point where this works, and/or (b) submitting a bug report would be my next options.

@ariel-phet, can you prioritize this?

@oliver-phet, has any user reported Edge bugginess consistent with this?

@jonathanolson
Copy link
Contributor Author

Best workaround so far would be detecting it by polling every frame (for every touch) with setPointerCapture, as it errors out when a pointer isn't active.

This doesn't work well, because Edge doesn't error out until you put another finger back down in the sim. Unsure of performance impact.

e.g.:

        // Workaround for not getting pointercancel, see https://github.com/phetsims/scenery/issues/645
        if ( platform.edge && pointer.isTouch ) {
          var target = this.attachToWindow ? document.body : this.display.domElement;
          if ( target.setPointerCapture ) {
            try {
              target.setPointerCapture( pointer.id );
            }
            catch ( e ) {
              console.log( 'LOST LOST LOST' );
              pointer.interruptAll();
              this.removePointer( pointer );
            }
          }
        }

@oliver-phet
Copy link

I have yet to receive any Edge bugginess similar to this.

@ariel-phet
Copy link

@jonathanolson considering our usage on Edge (very low), and other priorities, I am marking this a low (quite low). Best to focus on sim work and revisit this question after the summer.

@ariel-phet ariel-phet removed their assignment Jul 10, 2017
@jonathanolson
Copy link
Contributor Author

Understand, unassigning myself.

@phet-steele
Copy link
Contributor

@jonathanolson both procedures, tab switching and LoL zooming, are reproducible on my Win 10 Edge.

@phet-steele phet-steele removed their assignment Jul 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants