GithubHelp home page GithubHelp logo

Bugs out in safari on iPhone about pinch-zoom HOT 3 OPEN

tazhel avatar tazhel commented on September 21, 2024
Bugs out in safari on iPhone

from pinch-zoom.

Comments (3)

Todd1561 avatar Todd1561 commented on September 21, 2024

I've run into this, too. Specifically, what's happening is when you drag your finger outside the pinch-zoom box and release when you're outside the box pinch-zoom seem to get stuck in a limbo state where it thinks your finger is still on the screen (probably at the edge of the box) when it isn't. At this point you can no longer pan as it thinks you have 2 fingers on the screen, so you're stuck in this limbo state of zooming.

Unfortunately, I don't have a solution, I just wanted to include some more detailed into as to what's happening. Only "workaround" I've come up with is to use this project only when it consumes the entirety of your device screen so this situation can't arise to begin with.

from pinch-zoom.

Todd1561 avatar Todd1561 commented on September 21, 2024

After messing with this more I determined the issue is the "pointerup" event does not fire if your finger releases when not within the pinch-zoom box. Without this event firing it leaves pinch-zoom in a limbo state. The fix was actually pretty simple, rather than binding the "pointerup" event just to the pinch-zoom box I bound it to the entire document. That way no matter where the user releases it'll fire the event and return pinch-zoom to a normal state. All that needs to be changed is one line of code (line 105):

From this:
this._element.addEventListener('pointerup', this._pointerEnd);
To this:
document.addEventListener('pointerup', this._pointerEnd);

from pinch-zoom.

edman007 avatar edman007 commented on September 21, 2024

The pointerup event probably isn't firing because it was canceled. The version of pointertracker used by pinch-zoom doesn't listen for it so that's why the event is missing. Updating pointertracker fixes it. I have a pull request ( #26 ) that fixes it and adds some other things.

from pinch-zoom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.