Drag and Drop by click

Hey there,

I just wanted to know whether it is possible to put a DragSource onto a DropTarget by a click event and not actually by dragging it there. Just translating the DragSource by JavaScript did not work for me.

Thank you in advance and kind regards,
Sarah

Hi,

You can use the script below:

var dragSource = prez.object('drag source name');
prez.object('drop target name').dropHelper.drop(dragSource);

Regards

1 Like

Awesome! Thank you very much!!

Hey @ToanLS, just a quick follow-up question. Is it possible to put the DragSource by click back on it’s original position? “Clear user input” is not working unfortunately after changing the object state for feedback.

Kind regards
Sarah

Hi sariwest,

How did you change the object state?
I see that “Clear user input” action still works after changing the drag source state (using “Change Object State” action)

Regards

1 Like