I'm trying to implement a drag and drop window for...
# compose-desktop
b
I'm trying to implement a drag and drop window for users to upload images in the app. I see that it was implemented in 1.4 and there is a working example for showing a list of dragged files https://github.com/JetBrains/compose-multiplatform/issues/3294 I'm simply trying to alter this example to work with images. The interface says theres 3 types, FilesList, Images, Text but no matter what I drag into the box it's returning as FileList androidx.compose.ui.DragDataFilesListImpl@5e186db7 So changing the check from
if (dragData is DragData.FilesList)
to
if (dragData is DragData.Image)
is always false even if I drag an image in?
I don't see any way to alter this behaviour either? Anyone know why this sample is considering every input as a FileList and how do I get it to return Image if I actually drag an image in.
And I know I can read the image (if I decide its an image) from the file path I get back, but I'd really just like this to work as its seemingly described as possible without having to implement that.
The more I think and look at this, the more it seems like this is actually the intended behaviour if it's dragged from outside the app into the app. In the meantime I do have it working by taking the path and working with it myself.