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

Question: Can I prevent Rnd from being dragged onto a child of the bound parent? #870

Open
msueping opened this issue May 14, 2022 · 0 comments

Comments

@msueping
Copy link

I have a div (let's call it "container") which contains a Rnd that I want to be able to be dragged and stay within the "container". There is also another div within this "container" (let's call it "no fly zone"). I do not want the Rnd to be able to be dragged and left inside the "no fly zone". Is it possible to have this behavior with react-rnd?

I'm using react-rnd version 10.3.7

My browser is: Chrome Version 101.0.4951.54

I am sure this issue is not a duplicate

Reproduced project

https://codesandbox.io/s/purple-resonance-5613rb?file=/src/index.js:0-935

Steps to Reproduce

  1. Visit my codesandbox.
  2. Drag the "Rnd" over the red bordered area
  3. Notice that I can drop it there. How can I prevent this?
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