FormidableLabs / nuka-carousel

Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site.
https://commerce.nearform.com/open-source/nuka-carousel
Other
2.99k stars 594 forks source link

Pinch to zoom gesture blocked on iPhone #1020

Open mi-na-bot opened 1 year ago

mi-na-bot commented 1 year ago

Bugs and Questions

Describe Your Environment

"react": "18.2.0", "nuka-carousel": "^6.0.3",

The browser is the most recent stable version of iOS Safari.

Describe the Problem

The drag handling prevents pinch to zoom gesture. This usually occurs when a touch event handler only worries about the first element of the touches[] array, instead of making sure there is only one element.

Expected behavior:

On mobile browsers it should be possible for people to quickly zoom in and back out on the carousel images. Multi touches should probably be ignored by the library.

Actual behavior

Multi finger touches act like a single finger touch.

Additional Information

mi-na-bot commented 1 year ago

I would be interested in working on a PR for this, as long as allowing pinch to zoom would be considered desirable behavior.