Using resizeGrid causes left resize to actually change size to the right
Overview of the problem
Using resizeGrid causes resizing left to actually resize to right.
Happens at 10.2.2 forwards. Does not happen at 10.2.1. Most probably caused by #727.
Reproduced project
https://codesandbox.io/s/rnd-resize-left-bug-e9vnr
Steps to Reproduce
- Use any horizontal resizeGrid
- Try resizing left side
- Rnd component will change size to right side while left will stay fixed.
Expected behavior
Resizing should happen at the side that's grabbed.
Actual behavior
Resizes to opposite side.
please add the settings dragAxis={'x'}, it works
That fixes it BUT also restricts dragging the element in y-axis. Which is not wanted.
I am experiencing the same problem except with the vertical resizeGrid. I want to resize my grid upwards but they get stretched down at the bottom. Here's a video example.
Using dragAxis="y" in my case did not resolve the issue.
https://user-images.githubusercontent.com/24761660/138121957-2faaf736-df9b-433f-a1dc-8f402f110bf6.mov
Here is my code:
<Rnd
className={classes.root}
bounds="parent"
minHeight={gridHeight}
default={{
x: left,
y: top,
height,
width: gridWidth,
}}
resizeGrid={[0, gridHeight / 3]}
dragGrid={[gridWidth, gridHeight / 3]}
enableResizing={{
top: true,
bottom: true,
topLeft: false,
topRight: false,
left: false,
bottomLeft: false,
right: false,
bottomRight: false,
}}>
<div className={classes.card}>Appointment card</div>
</Rnd>
I'm seeing this same issue in 10.3.5, however I am setting the dragAxis={'x'} and the right side still scales out.
This happens when you set the resizeGrid={[1, 0]}
In other words if you set snap grid to 0 in the Y axis even if you have constrained it to the X axis is causes the Right side to example when you drag the left dragger.