I am implementing a functionality where data in dataTransfer will be set on dragstart
event which will be invoked manually when user tries to drag some other element. So I used this jQuery to trigger dragstart
event -
$(elem).trigger('dragstart');
This invokes the event perfectly but originalEvent
property of jQuery Event is missing. Hence, I am unable to set Data in data transfer.
event.originalEvent.dataTransfer.setData('text','aa'); //Here comes the error
See error in console
But if this event is invoked when trying to drag, the property is available and dataTransfer works just fine.
Here's a fiddle of what I am facing.
Any help would be appreciated.