question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Double tap to zoom does not work

See original GitHub issue

On touch screens in certain browsers, double tapping does not zoom images the way double clicking does:

  • Firefox (Android and Windows): does not work
  • Chrome (Android and Windows): does not work
  • Samsung Internet on Android: does not work
  • Edge: works
  • IE11: works

Most end users will expect that double-tapping will zoom the image because that is the way nearly all image viewers with touch-enabled interfaces work (see the stock image viewer on Windows/iOS, for example).

In theory, this should be covered by the onDoubleClick event handler that is attached to the image div, but the touch handlers seem to prevent this from happening. Removing

onTouchStart={this.handleTouchStart}

from the ril-outer div confirms that double tap to zoom otherwise seems to works fine on Firefox, but there is no change in Chrome or Samsung Internet (pinch to zoom and swipe still work for some unknown-to-me reason, even without any of the touch handlers).

Different operating systems interpret double clicks slightly differently, and some systems such as Windows allow the user to change the double click speed. I don’t know if all browsers actually respect that setting for taps, but I don’t think it makes sense to implement double tap functionality ourselves if the onDoubleClick event can handle it.

However, I don’t know the best way to fix this, even after looking at the code for several hours. Any thoughts?


On an unrelated note, at over 1800 lines this component is very large and as a result is fairly difficult to decipher. Perhaps some functionality should be broken off into separate components?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
Shashank2406commented, Oct 9, 2019

Fixed in my fork, also added some new props https://github.com/Shashank2406/lightbox-react

0reactions
Slapboxcommented, Oct 9, 2019

@Shashank2406 very cool! I’m excited to give it a try!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Double tap three fingers not working on iPhone x
You can do this by going to Settings > Accessibility > Zoom, then turn off Zoom and back on.
Read more >
Double tap to zoom stopped working after upgrading to iOS 13
Double tap is being used to select a word in text on iOS13, so it might not work correctly when used not for...
Read more >
iPhone Double-tap to zoom gone? - MacRumors Forums
Yes double tap zoom does not work reliable anymore! This is annoying, as I was also using it all the time.
Read more >
How to Fix iPhone Stuck in Zoom Mode - Techbout
If double-tapping does not work, try double tapping again, but this time keep your fingers on the screen after the second tap and...
Read more >
Double tap to zoom doesn't work on mobile sites in Chrome ...
Currently double-tapping to zoom only seems to work when "Desktop site" is checked and doesn't work on normal mobile sites.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found