retyui / react-quick-pinch-zoom

A react component that providing multi-touch gestures for zooming and dragging on any DOM element.
https://react-quick-pinch-zoom.netlify.app/
310 stars 47 forks source link

Scrolling using trackpad on macos does not work #10

Closed ashbrowning closed 4 years ago

ashbrowning commented 4 years ago

When using two fingers to scroll on a macos trackpad, nothing happens whereas I would expect a normal scroll experience. Pinching-to-zoom works fine, which is based off the same WheelEvent (just that the event.ctrl flag is set to true).

retyui commented 4 years ago

Please use shouldInterceptWheel to change this behavior:

const shouldInterceptWheel = () => false;

return <QuickPinchZoom 
    shouldInterceptWheel={shouldInterceptWheel}
    onUpdate={onUpdate}>
      <img ref={imgRef} src={IMG_URL} />
</QuickPinchZoom>;
ashbrowning commented 4 years ago

This will mean that the scrolling gestures on the trackpad, as well as the scrolling the wheel on a mouse, will result in zooming in/out of the content.

Surely there's a case for supporting both scrolling and zooming of the content via the wheelEvent?

ashbrowning commented 4 years ago

@retyui - what are your thoughts on the above?

retyui commented 4 years ago

I hardly understand the problem that you want report