dimsemenov / PhotoSwipe

JavaScript image gallery for mobile and desktop, modular, framework independent
http://photoswipe.com
MIT License
24.17k stars 3.31k forks source link

Pointer movement shouldn't prevent clicks until a minimum threshold of movement #2125

Open noisefloordev opened 1 week ago

noisefloordev commented 1 week ago

onPointerMove sets this.isDragging, which prevents a tap after a drag. However, there's no thresholding, so any pointer movement at all prevents a click. This causes lots of clicks to be lost. Modern mice are extremely sensitive, and I often have to click 3-4 times before PhotoSwipe will recognize a click. It keeps seeing miniscule pointer movements between the press and release as my finger press causes the mouse to move slightly.

Normal browser click events do this thresholding automatically, but PhotoSwipe is using pointer events instead, so it doesn't take advantage of that. This makes PhotoSwipe really frustrating to use as I have to click over and over to zoom in and out. This may not have been a problem when this code was originally written (it looks like this project has been around for a long while!), but modern laser mice are precise to a fault.

dimsemenov commented 1 week ago

That's an interesting issue, I'll look into that. What exactly mouse are you using? Or is it some kind of software for it?

noisefloordev commented 1 week ago

It's the Razer Basilisk V3, on a QcK mousepad.