Web Drag & Drop example?

Was trying to do a little Drag and Drop of a Picture… despite best efforts…still having trouble so turned to the Example included with the current release.
Web --> Drag and Drop --> Drag Test.

It builds just fine but I cannot get it to drag and drop an image/picture internally to the Picture destination panel. I never even get the hover style on the picture destination panel. Does everyone else have this issue or is it a personal problem for me. :stuck_out_tongue:

Yes, I see lots of posts about drag and drop but nothing that indicates a drag within a Xojo app from two properly configured controls that support drag and drop of pictures shouldn’t work. Many of those posts are 2-4 years old so generally…although examples are occasionally out of date --I lean toward the assumption that the functionality they demonstrate works in the current release unless it’s an unrealized defect.

I think that code needs to be updated. If I understand corrctly, that example will not show the picture on the destination area and is not working as expected.

Maybe this video will help you https://youtu.be/rPkK7RiF1Pg

I was not able to find the code for the sample shown on the video. It will be good if that code was included with Xojo too. I hope they will add more examples to Web when they release Web 2.0.

Robert, after playing with the example (Examples / Web / Drag and Drop / DragTest ) I was able to “fix” it by changing the code in PictureMoveContainer - Shown event to:

'me.AcceptPictureDrop(WebDragItem.DragActionMove) Me.AcceptPictureDrop(3) me.DragOverStyle = StyleHover

it looks like either:
a) a bug or
b) AcceptPictureDrop needs Copy (1) too and not only Move (2)
but b) is not the expected behavior.

Testing some more, it looks like that example started with Xojo2015r3.1 and it never worked as expected.

My guess is that it was created on a developer version and something changed for the release. I will create a Feedback case.

More tests, the DragTest example:

  • works correctly in Chrome
  • works correctly in Firefox
  • doesn’t work correctly in Safari (this machine opens Safari by default while testing web apps)
  • doesn’t work correctly using an Android phone with Chrome (works like Safari but can’t drag the ImageWell)

Is Safari 13.1 the latest?

Edit: created <https://xojo.com/issue/59571> to see if something can be done to make the drag and drop work in Safari and mobile. Maybe with Web 2.0 this already works?

[quote=481089:@Alberto DePoo]More tests, the DragTest example:

  • works correctly in Chrome
  • works correctly in Firefox
  • doesn’t work correctly in Safari (this machine opens Safari by default while testing web apps)
  • doesn’t work correctly using an Android phone with Chrome (works like Safari but can’t drag the ImageWell)

Is Safari 13.1 the latest?

Edit: created <https://xojo.com/issue/59571> to see if something can be done to make the drag and drop work in Safari and mobile. Maybe with Web 2.0 this already works?[/quote]
Drag & Drop will be coming to Web 2.0 in a future release, but not the first one.

It should also be noted that the source and target controls must have at least one common drag mode and type between them, so it may be that Safari no longer allows a “move” type (or something else changed).