BetterTyped / react-zoom-pan-pinch

🖼 React library to support easy zoom, pan, pinch on various html dom elements like <img> and <div>
MIT License
1.47k stars 266 forks source link

Scrolling in mobile #434

Open gabifuse opened 10 months ago

gabifuse commented 10 months ago

Hello!

I have the following structure


        <div style={{ height: '100px', width: '300px', overflowY: 'auto', overflowX: 'hidden', background: 'red' }}>
            <TransformWrapper wheel={{ wheelDisabled: true }} panning={{ velocityDisabled: true }} ref={transformComponentRef}>
                {(): JSX.Element => (
                    <TransformComponent
                        contentStyle={{ height: '100%', display: 'flex', flexDirection: 'column', overflow: 'hidden' }}
                        wrapperStyle={{ display: 'flex', flexDirection: 'column', overflow: 'hidden' }}
                    >
                        <div style={{ height: '200px', width: '300px', background: 'blue', color: 'white' }}>test</div>
                    </TransformComponent>
                )}
            </TransformWrapper>
        </div>

I want to allow only zooming and when clicking on a button to use the ref and get the zoom back to the initial (this part works perfectly). The problem starts on mobile devices where the native scroll of the user seems to not be working and i cant scroll past the first 100px, even though on desktop scrolling works fine. any idea on why this is and how can i get it to work?

Thanks in advance, Gabi.

SeanBarker182 commented 8 months ago

I have this same issue. Did you find a resolution?

wilderPariona commented 6 months ago

any solution?

ekunitsa commented 4 months ago

same problem

Logan-FE commented 3 weeks ago

any solution on this?