I am trying to create a dragEvent and fire it programmatically using this code on Chrome:
var ev = document.createEvent("MouseEvents");
ev.initEvent("dragstart");
and then fire it this way:
element.dispatchEvent(ev);
The element has draggable attribute.
The event was dispatched successfully. However on the event being fired - the dataTransfer object is null. Even when I try to set it manually to a working dataTransfer object - it still stays null.
Any ideas?
Thanks