I have created a drag and drop interface that will eventually be turned into a form builder. I've created a fiddle of the form builder http://jsfiddle.net/szASZ/1/. Everything seems to be working properly when you drag one of the top items into the gray drop zones beneath it.
However, where I am getting the issue is when you refresh the page/fiddle and try to sort the items within the drop zone. If you grab the "Radio Input" at the top of the first drop zone and move it within or outside of that drop zone, everything works properly.
Now, try dragging the last item "Checkbox Input" within its drop zone and everything should work correctly as well. Finally, refresh the page/fiddle and move that same, last "Checkbox Input" to another drop zone. The placeholder will show and then never go away. What I am finding is that "onDragEnd" event is never called during this instance of the drag and drop cycle, but it is called every other time. This event is normally relayed to the top level of the form builder where it takes the item that is being dragged and sets it in the new array of data.
To make things all the more fun, if I add an empty object onto the arrays that contain the dropped items (http://jsfiddle.net/szASZ/ - Line 30, 34), everything works as expected so it would seem that the last item in the array of "drop zone" items does not properly fire the "onDragEnd" event.
componentWillMount: function () {
var newInput = [
{ "classes": "soft-half push-half--bottom brand-bg--gray-dark brand-color--white", "title": "Text Input" },
{ "classes": "soft-half push-half--bottom brand-bg--gray-dark brand-color--white", "title": "Checkbox Input" },
{ "classes": "soft-half push-half--bottom brand-bg--gray-dark brand-color--white", "title": "Radio Input" }
];
var newZones = [
[
{ "classes": "soft-half push-half--bottom brand-bg--gray-dark brand-color--white", "title": "Radio Input" },
{ "classes": "soft-half push-half--bottom brand-bg--gray-dark brand-color--white", "title": "Text Input" },
{ "classes": "soft-half push-half--bottom brand-bg--gray-dark brand-color--white", "title": "Checkbox Input" }
,{}
],
[
{ "classes": "soft-half push-half--bottom brand-bg--gray-dark brand-color--white", "title": "Text Input" },
{ "classes": "soft-half push-half--bottom brand-bg--gray-dark brand-color--white", "title": "Checkbox Input" }
,{}
]
];
this.setState({ inputs: newInput });
this.setState({ zones: newZones });
}
Basically, this is the main problem that I am having and I have no idea why every other item gets sorted, dropped and the events trigger properly but the last one? Thanks!