react-draggable
react-draggable copied to clipboard
Dynamically adding components and jumping issue
Hi!
I'm creating a visual coding environment and need to create draggable div's on-demand. There seems to be an issue where if I add components they get added side by side even if I explicitly set the position to for example {x: 0, y: 0}. The expected behavior is that the divs will be added exactly on the point that I have defined. This same problem happens when I remove a div, the other boxes jump around the screen as if they remember which position they were added in.
Any way to disable this behavior?

Related to #650
The trick that worked for me is applying css position: 'relative' to the parent element (the one containing the draggables) and adding css position: 'absolute' to the draggable's css class "handle". Then the elements are positioned exactly where you define the initialPosition and they overlap if needed.