I have a drag and drop functionality on my angular web page and it works great on Chrome Version 60.0.3112.78 but it does not work on FF 54.0.1 and Microsoft Edge. I noticed that property
event.toElement
does not exist on FF and ME that's why I have my error. Why is it happening?
var ondrop = function(event) {
event.preventDefault();
var from = parseInt(event.dataTransfer.getData('dragElementIndex'));
var toElement = getItemElement(event.toElement);
var to = getContainerIndex(toElement);
if (from !== to && to !== -1) {
scope.reorder(from, to);
}
scope.$apply();
};