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

Chrome iOS can cause zoom with one finger #2068

Open
bakura10 opened this issue Sep 26, 2023 · 4 comments
Open

Chrome iOS can cause zoom with one finger #2068

bakura10 opened this issue Sep 26, 2023 · 4 comments
Labels

Comments

@bakura10
Copy link

Hi,

We had a user of one of our theme (which relies on PhotoSwipe for zooming) a strange issue that happens exclusively on Chrome iOS (Safari does not exhibit the issue).

It is a bit complex to explain, so I will attach a video, but to reproduce the issue you have to:

  1. Open the zoom.
  2. Maintain a long tap on the image to show contextual menu.
  3. Close the contextual menu.
  4. Move your finger.

Instead of moving the image, it will actually zoom. This is also reproducible on the library demo.

video.mov

Thanks :)

@dimsemenov dimsemenov added the Bug label Sep 27, 2023
@dimsemenov
Copy link
Owner

Odd issue, I'll look into it. It's possible to disable the context menu by calling preventDefault on pointerdown, but that's not ideal.

@bakura10
Copy link
Author

Thanks a lot for investigating this issue :)

@dimsemenov
Copy link
Owner

Fought with this for half of a day. It seems in the new iOS Chrome update neither pointerup nor pointercancel is called when the context menu disappears. Pointer-capture also doesn't help, and lostpointercapture event never fires.

The Firefox on IOS does seem to work correctly.

I'm not sure yet what to do, as the only thing that helps is disabling the context menu via something like:

lightbox.on('bindEvents', () => {
  lightbox.pswp.scrollWrap.ontouchstart = (e) => e.preventDefault();
});

The other thing that helps also is switching from pointer events back to old touch events API. With touch events touchend does fire right before the next touchstart.

@bakura10
Copy link
Author

Thanks for spending time on this. We should open a bug tracker to Chrome. I think you have more context about the issue than I have, can you please try to open one ? Otherwise I will try to do it myself :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants