-
Notifications
You must be signed in to change notification settings - Fork 1k
3.2.0 Breaking Change: Drag Callbacks #391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A couple ideas @STRML to "keep the old "absolute" offsets in callbacks from <= 3.1.1?":
If neither of the above ideas seem like viable solutions, then I think a major version would be most useful to my needs. |
I think a new param works, perhaps |
@STRML I think that is a great plan! Do you need help implementing it? |
Yeah, that would be great if you have the time! |
I've PR'd a first pass at doing this: #393 |
I think this can now be closed @STRML ? |
It appears there was an inadvertent breaking change in 3.2.0 relating to #361.
Prior to 3.2.0, if a defaultPosition were present, it became the
x
andy
present in the callback on the initial drag and subsequent to that.In 3.2.0, the
x
andy
received in the callback is relative to the defaultPosition already passed. So if you pass adefaultPosition
ofx: 100, y:100
and initiateonDragStart
, the callback will contain{x: 0, y: 0}
in the data. This makes sense if you considerdefaultPosition
to be something more likeinitialOffset
, and is required if your offset is something like, for example,{x: '10%', y: '10%'}
.Ref: bokuweb/react-rnd#437 and a broken build at https://circleci.com/gh/bokuweb/react-rnd/1340.
Next Steps
Our choices:
<Draggable>
in a div with atransform: translate(10%, 10%)
.Ping @tnrich.
I've pulled 3.2.0 from npm and will be releasing a 3.2.1 with just the TS export fix.
The text was updated successfully, but these errors were encountered: