Thursday 23 August 2018

Drag and drop issues

Hello everyone. I built an electron app and want to have a drag and drop feature where an image is dropped onto the window and it display. Now, this was working on an old version of electron, but I had to wipe my hard drive and installed electron 3. The problem is, when I drag the image over my app, I see, what I can only describe as a stop sign.Here is my code:​window.addEventListener("dragover", function(event){event.preventDefault();event.stopPropagation();},false);​// when file is dropped, check if it is an image, if not do nothingwindow.addEventListener("drop", function(event){ console.log(event); event.preventDefault();event.stopPropagation();// if dragged file is an imagedisplayImage( event.dataTransfer.files[0].path.toString(), true, -10);}, false);​Thanks for any pointers

Submitted August 24, 2018 at 12:38AM by daibatzu

No comments:

Post a Comment