willnguyen1312 / zoom-image

A little yet powerful framework agnostic headless library to zoom images on the web

Home Page:https://willnguyen1312.github.io/zoom-image/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Long press on mobile seems to interfere with zoom

arobbins opened this issue · comments

Describe the bug

While zooming on mobile, if you "long press" the image it will sometimes zoom and other times open the phone's default image options. This can be quite frustrating when you're simply expecting the image to zoom only.

I've recorded a video of the bug below from my iPhone 11 on Safari.

RPReplay_Final1717780123.mp4
RPReplay_Final1717781046.mp4

Whether or not you explicitly restrict the phone's native image function is debatable I guess.

Would it be better to provide a "zoom icon" that overlays the image for mobile instead? That way the user can click the icon and begin the zoom, which would solve for the ambiguous expectations. I think it would be appropriate to restrict the native phone functionality at that point.

Reproduction

See above

Used Package Manager

npm

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is available

Hi Andrew. It's funny that I found similar thing while solved this issue #299 of yours. I believed it's a native feature of mobile phone to let users download image to their phone's storage by hard-press / long-press. Normal press won't face this issue 😃

Whether or not you explicitly restrict the phone's native image function is debatable I guess.

I'm absolutely with you on this. I didn't touch this area since it belongs to users' space. As a library author, I typically aim for maximum flexibility instead of restriction toward developers :)

I will give it some digging today after work. Thanks so much for your work on creating an issue with your thoughts :)

I've recorded a video of the bug below from my iPhone 11 on Safari.

Same phone and browser on my end too. I inherited the phone from my wife when she upgraded her phone to 13 model lol

I've recorded a video of the bug below from my iPhone 11 on Safari.

Same phone and browser on my end too. I inherited the phone from my wife when she upgraded her phone to 13 model lol

Haha exact same situation as me! I appreciate your hard work Nam. Looking forward to hearing more.

Hi Andrew, I just shipped a new option called disabledContextMenu to zoom image move. By default, it's false. If you turn it on, it will prevent zoomed image from being right-clicked / long-pressed to open context menu which is the reason why zoom experience has got disrupted. You can adjust this value on whichever devices / situations you serve. Please try it out and give me feedback. Thanks 😊

Confirmed fixed. Thanks a million!