jarvisniu / vue-zoomer

Zoom the image or other thing with mouse or touch
MIT License
150 stars 38 forks source link

Support - Pinch zooming on mobile devices forces browser zoom #30

Closed alexwahlandt closed 2 years ago

alexwahlandt commented 2 years ago

Hi!

I'm trying to implement vue-zoomer in a project and it works flawlessly on desktop. On mobile devices on the other hand, pinch zoom causes the browser to zoom in, instead of the image in the vue-zoomer.

I have created a sandbox where I tried to replicate your "Single image" demo and I get the same behaviour. Link to sandbox

Follow up question: Is "user-scalable=no" required in the meta tag for this to work?

jarvisniu commented 2 years ago

Yes,

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

is must have if you want to use it on mobile devices.

But nowadays, some browser will still ignore this. Like mobile safari will ignore it if your page contains a font-size < 16px.

I don't know if there are other reasons that mobile safari will do it.

If you find your answer, you can write it here. Other developers and i will be very thankful!