Comments (3)
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.
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.
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)
- Feature request: ability to disable pinch-zooming HOT 2
- Configurable zoom factor using mouse wheel
- Affects whole screen on Chrome on iOS
- customElements is not defined HOT 2
- Prevent translation out of pinch-zoom HOT 4
- Text inputs inside pinch-zoom are not interactable HOT 4
- Feature request: Additional event in case of reaches of the minScale case
- Makes zoom by clicks and taps actions HOT 5
- Feature request: zoom entire view port
- support rotation
- Vue TSLint Error
- Draggable element inside pinch-zoom component HOT 1
- dead demo link
- It doesn't work on IE HOT 1
- Pro installation instructions are unclear HOT 1
- Firefox not working properly? HOT 2
- pointer-tracker not found HOT 3
- pinch-zoom injects styles into <head>, won't work in ShadowRoots.
- Add min-scale HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pinch-zoom.