Skip to content
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

onDragStop and onResizeStop position issue #882

Open
sahildaswani opened this issue Oct 29, 2022 · 0 comments
Open

onDragStop and onResizeStop position issue #882

sahildaswani opened this issue Oct 29, 2022 · 0 comments

Comments

@sahildaswani
Copy link

Seems like when I drag it is returning the relative position and when I resize it is returning the absolute position

size={{ width: stickyWidth, height: stickyHeight }}
position={{ x: stickyLeft, y: stickyTop }}
onDragStop={(e, d) => {
  console.log("drag stop", d);
  setStickyTop(d.y);
  setStickyLeft(d.x);
}}
onResizeStop={(e, direction, ref, delta, position) => {
  console.log(direction, ref, delta, position);
  setStickyWidth(ref.offsetWidth);
  setStickyHeight(ref.offsetHeight);
  setStickyTop(position.y);
  setStickyLeft(position.x);
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant