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

Append overflow option to props #56

Closed hyesungoh closed 2 years ago

hyesungoh commented 2 years ago

Hello there

I'm using your project with love.

when I using this project, I thought it would be nice to have overflow props for wrapper div.

So I append overflow option to PinchZoom component.

as is

https://github.com/retyui/react-quick-pinch-zoom/blob/d5615059cabb8563ab04e9df7c6f41fe04425b77/src/PinchZoom/component.tsx#L990-L995

always overflow: hidden at this div

to be

So I append overflow option (boolean type).

and handle this at styles (convert to function) d6b464125192ab9f92f8fce4a79f97baefdbdc6f

more type for overflow?

I think overflow option can define to below type.

overflow: boolean | 'x' | 'y';

// 'x' will be
// overflow-x: visible;
// oveflow-y: hidden;

What do you think about it?

retyui commented 2 years ago

Thanks for contribution! I am not sure that you approach is flexible and salable in case when (overflow also can be auto, scroll, clip )

it developer need to apply custom overflow he/she can create a new css class, and pass it

<QuickPinchZoom className='myClassWithOverflow'/ >
hyesungoh commented 2 years ago

Oh, I did not know this approach!

<QuickPinchZoom className='myClassWithOverflow'/ >

Thanks to answer me :D I will close this pr