-
Notifications
You must be signed in to change notification settings - Fork 57
Description
For some reason that is still unknown to me, and was detected during the development process of PR #2329 , When using the Panel component with a defined width and height, a transform class with a translate() method will be added to style (e.g. transform: translate(523px, 584px))
With the latest update of react-rnd 10.2.1 to 10.3.4 this issue persists which probably means the error is coming from the Panel Component. It can also mean that this issue has not been yet addressed in react-rnd which I find strange, since seem to be a rather obvious issue.
As a workaround, adding x and y props with values 1 solves the issue. Maybe that is intended, but it should not be, since it's not obvious at all.
In the following screenshot you can see the difference between having no x, y props (before [left]) and having those defined (after [right]):
Before:
<Panel
style={{position: 'relative'}}
title="Initial size (673 * 134)"
resizeOpts={true}
width={673}
height={134}
>
Panel with initial size.
</Panel>
After:
<Panel
style={{position: 'relative'}}
title="Initial size (673 * 134)"
resizeOpts={true}
width={673}
height={134}
x={1}
y={1}
>
Panel with initial size.
</Panel>