react-gallery-carousel icon indicating copy to clipboard operation
react-gallery-carousel copied to clipboard

Maximize and minimize using soft touch on trackpad

Open jr-dw-dev opened this issue 2 years ago • 5 comments

Describe the bug If I use the soft touch of my Macbook trackpad and do not push it down physically in order to click the image to zoom in or out (maximizeOnClick and minimizeOnClick), it sometimes works and sometimes doesn't. This happens because the event.buttons property of the mouseDown-Event is randomly set to 0 or 1. As you check for it to be > 0, it randomly just does nothing.

It would be cool if you could remove the check for event.buttons > 0 from the handleMouseDown method for it to work on Macbooks again.

To Reproduce Steps to reproduce the behavior:

  1. activate shouldMaximizeOnClick and/or shouldMinimizeOnClick
  2. Tap on the image using soft touch of trackpad multiple times
  3. randomly it will do what you expect it to do or just do nothing without an error

Expected behavior maximize and minimize work with trackpad

Desktop (please complete the following information):

  • OS: iOS 12.6
  • Browser Chrome
  • Version 108.0.5359.94

jr-dw-dev avatar Dec 08 '22 09:12 jr-dw-dev

Reproducable on Lenovo Thinkpad

jr-dw-dev avatar Dec 15 '22 14:12 jr-dw-dev

Hi @jr-dw-dev , thanks for raising this issue up! I will investigate it next weekend!

yifaneye avatar Dec 31 '22 04:12 yifaneye

Hi @jr-dw-dev ! I can reproduce your bugs. If I touch it fast (which I have already got used to), it always works as expected. But, if I touch it slowly, it occasionally does not work. That's because there is movement in the touch, resulting in the touch being recognized as dragging the slide sideways.

yifaneye avatar Jan 28 '23 13:01 yifaneye

Sorry for responding only now. I have the same problem with clicking fast. But anyways, for us it ended in showing the button, which we originally didn't want to have.

So if I understand you correctly, the event.buttons > 0 should differentiate between dragging and clicking? Then it would probably be cool to implement a certain number of pixels which need to be moved to make it a swipe, anything under that could be a click.

digitalwert-devs avatar May 08 '23 09:05 digitalwert-devs

Are there any updates about this problem? It#s been more than a year now..

digitalwert-devs avatar Feb 26 '24 10:02 digitalwert-devs