DEV Community

Samuel Kendrick
Samuel Kendrick

Posted on

How can I get draggable items to stack on top of each other using react-draggable?

Hey! Check out my PR: https://github.com/VEuPathDB/CoreUI/pull/140/files

In it I've added a general purpose draggable panel component which renders its children into a panel that can be repositioned by users via drag and drop. To accomplish the dragging/dropping, I depend on react-draggable. I was surprised to see that when I dragged items, the most recently dragged item WAS NOT on top of the other items. Here's what I discovered was happening:

https://youtu.be/bjXWnhiJR0s

YouTube:

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay