Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Mouse panning breaks zoom on Android (panMode: "mousemove") #653

@zackpyle

Description

@zackpyle

Describe the bug

When you enable mouse panning, it seems to break Android zooming. After you pinch to zoom in, you can't pinch to zoom our or back in or pan. It freezes. The toolbar buttons work, and you can exit, or move to the next gallery image. But once you pinch to zoom, and then let go, it stops working on that image.

Reproduction

Using Android Chrome:

  1. Tap the image to open fancybox
  2. Use fingers to pinch to zoom in
  3. Release fingers
  4. You can no longer use fingers to zoom, or to drag the enlarged image, you can only use the toolbar buttons

Note - Works as intended on iphone

Tested on a real Android phone (Galaxy A54) and in Browserstack (Galaxy S23 set using "real device" not emulation)

Additional context

Fancybox.bind('[data-fancybox="gallery"]', {
    loop: true,
    contentClick: "toggleMax",
    Images: {
        Panzoom: {
            maxScale: 2,
            panMode: "mousemove",
            mouseMoveFactor: 1.1,
            mouseMoveFriction: 0.12,
        }
    }
});

Commenting out these 3 lines fixes it:

// panMode: "mousemove",
// mouseMoveFactor: 1.1,
// mouseMoveFriction: 0.12,

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue has not been triaged by maintainers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions