react-draggable icon indicating copy to clipboard operation
react-draggable copied to clipboard

Providing both bounds (left, right) creates a weird snapping and then full-stop of resizing.

Open growthwp opened this issue 4 years ago • 2 comments
trafficstars

Assuming your component looked like this:

<Draggable bounds={{ right: 580, right: 580 }} nodeRef={nodeRef} axis={'x'}>
</Draggable>

What ends up happening is the drag snaps to whatever direction and then becomes unusable. The expected behavior is that of being able to drag on the X axis for 1160px (so, we shouldn't hit the edges of a 1200px container).

growthwp avatar May 29 '21 08:05 growthwp

I believe you would want bounds={{ left: -580, right: 580 }} in that case. Specifying both left and right as 580 allows you to drag the element a total of zero pixels to either side, as they are both on the X axis (left is not reversed).

LoganDark avatar Jul 02 '21 10:07 LoganDark